Skip to content

Commit

Permalink
ci: use autofix.ci (#784)
Browse files Browse the repository at this point in the history
* ci: use autofix.ci

* ci: nllint

* test

* ci: fix the usage of jsonnetfmt

* [autofix.ci] apply automated fixes

* ci: fix

* [autofix.ci] apply automated fixes

* ci: fix jsonnetfmt

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
suzuki-shunsuke and autofix-ci[bot] authored Jan 31, 2025
1 parent 70f478a commit 404bbc9
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 116 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/autofix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: autofix.ci
on: pull_request
permissions: {}
jobs:
autofix:
runs-on: ubuntu-24.04
permissions: {}
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
with:
aqua_version: v2.43.0
- run: aqua upc -prune
- run: git ls-files | nllint -s -f
- run: |
git ls-files | grep -E "\.jsonnet$" | xargs -n 1 jsonnetfmt -i
git ls-files | grep -E "\.libsonnet$" | xargs -n 1 jsonnetfmt -i
- run: bash scripts/generate.sh
- uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1
123 changes: 20 additions & 103 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,39 @@ permissions: {}
jobs:
path-filter:
# Get changed files to filter jobs
timeout-minutes: 30
timeout-minutes: 10
outputs:
update-aqua-checksums: ${{steps.changes.outputs.update-aqua-checksums}}
renovate-config-validator: ${{steps.changes.outputs.renovate-config-validator}}
ghalint: ${{steps.changes.outputs.ghalint}}
preset: ${{steps.changes.outputs.preset}}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
update-aqua-checksums:
- aqua.yaml
- aqua/*.yaml
- aqua-checksums.json
- .github/workflows/test.yaml
renovate-config-validator:
- renovate.json5
validate:
preset:
- "*.json"
ghalint:
- .github/workflows/*.yaml
- aqua/ghalint.yaml
update-aqua-checksums:
# Update aqua-checksums.json and push a commit
needs: path-filter
if: needs.path-filter.outputs.update-aqua-checksums == 'true'
uses: aquaproj/update-checksum-workflow/.github/workflows/update-checksum.yaml@8bce60cc4475128360bc32f00707abb874ca4a91 # v1.0.3
permissions:
contents: read
with:
aqua_version: v2.43.0
prune: true
secrets:
gh_app_id: ${{secrets.APP_ID}}
gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}}
status-check:
# This job is used for main branch's branch protection rule's status check.
# If all dependent jobs succeed or are skipped this job succeeds.
timeout-minutes: 10
runs-on: ubuntu-latest
needs:
- renovate-config-validator
- validate-presets
- ghalint
permissions: {}
if: failure()
steps:
- run: exit 1

renovate-config-validator:
# Validate Renovate Configuration by renovate-config-validator.
Expand All @@ -55,41 +50,11 @@ jobs:
permissions:
contents: read

enable-automerge:
# Enable automerge to merge pull requests from Renovate automatically.
timeout-minutes: 30
runs-on: ubuntu-latest
needs:
- status-check
permissions:
contents: write # For enable automerge
pull-requests: write # For enable automerge
if: |
! failure() && ! cancelled() && github.event.pull_request.user.login == 'renovate[bot]' && contains(github.event.pull_request.body, ' **Automerge**: Enabled.')
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{secrets.APP_ID}}
private_key: ${{secrets.APP_PRIVATE_KEY}}
permissions: >-
{
"contents": "write",
"pull-requests": "write"
}
repositories: >-
[
"${{github.event.repository.name}}"
]
- run: gh -R "$GITHUB_REPOSITORY" pr merge --squash --auto --delete-branch "$PR_NUMBER"
env:
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # Use GitHub App to trigger GitHub Actions Workflow by merge commit.
PR_NUMBER: ${{github.event.pull_request.number}}

validate-presets:
timeout-minutes: 30
timeout-minutes: 15
runs-on: ubuntu-latest
needs: path-filter
if: needs.path-filter.outputs.preset == 'true'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -107,37 +72,9 @@ jobs:
fi
done
jsonnetfmt:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
with:
aqua_version: v2.43.0
- run: jsonnetfmt --test jsonnet/*.jsonnet jsonnet/*.libsonnet

status-check:
# This job is used for main branch's branch protection rule's status check.
# If all dependent jobs succeed or are skipped this job succeeds.
timeout-minutes: 30
runs-on: ubuntu-latest
needs:
- update-aqua-checksums
- validate-presets
- renovate-config-validator
- ghalint
- jsonnet
permissions: {}
if: failure()
steps:
- run: exit 1

ghalint:
# Validate GitHub Actions Workflows by ghalint.
timeout-minutes: 30
timeout-minutes: 15
needs: path-filter
if: needs.path-filter.outputs.ghalint == 'true'
runs-on: ubuntu-latest
Expand All @@ -154,23 +91,3 @@ jobs:
- run: ghalint run
env:
GHALINT_LOG_COLOR: always

jsonnet:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
with:
aqua_version: v2.43.0
- run: jsonnet --version
- run: |
bash scripts/generate.sh
git add .
if ! git diff --cached --exit-code; then
echo "Please run 'bash scripts/generate.sh'" >&2
echo "::error title=Please run 'bash scripts/generate.sh'::"
exit 1
fi
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md).
## License

[MIT](LICENSE)

54 changes: 42 additions & 12 deletions aqua/aqua-checksums.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,33 @@
"algorithm": "sha256"
},
{
"id": "github_release/github.com/rhysd/actionlint/v1.6.26/actionlint_1.6.26_darwin_amd64.tar.gz",
"checksum": "BFA890E77A8508603C785AF09A30BBAB3A3255D291D8D27EFC3F20AC8E303A8E",
"id": "github_release/github.com/rhysd/actionlint/v1.7.7/actionlint_1.7.7_darwin_amd64.tar.gz",
"checksum": "28E5DE5A05FC558474F638323D736D822FFF183D2D492F0AECB2B73CC44584F5",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/rhysd/actionlint/v1.6.26/actionlint_1.6.26_darwin_arm64.tar.gz",
"checksum": "5E131AB7DE7AD051E1923B80D167AAA414734E97C720698C48778250E1DD2590",
"id": "github_release/github.com/rhysd/actionlint/v1.7.7/actionlint_1.7.7_darwin_arm64.tar.gz",
"checksum": "2693315B9093AEACB4EBD91A993FEA54FC215057BF0DA2659056B4BC033873DB",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/rhysd/actionlint/v1.6.26/actionlint_1.6.26_linux_amd64.tar.gz",
"checksum": "F0294C342AF98FAD4FF917BC32032F28E1B55F76AEDF291886EC10BBED7C12E1",
"id": "github_release/github.com/rhysd/actionlint/v1.7.7/actionlint_1.7.7_linux_amd64.tar.gz",
"checksum": "023070A287CD8CCCD71515FEDC843F1985BF96C436B7EFFAECCE67290E7E0757",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/rhysd/actionlint/v1.6.26/actionlint_1.6.26_linux_arm64.tar.gz",
"checksum": "A1056D85D614AF4F6E5517ED2911DAB2621B8E97C368C8B265328F9C22801648",
"id": "github_release/github.com/rhysd/actionlint/v1.7.7/actionlint_1.7.7_linux_arm64.tar.gz",
"checksum": "401942F9C24ED71E4FE71B76C7D638F66D8633575C4016EFD2977CE7C28317D0",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/rhysd/actionlint/v1.6.26/actionlint_1.6.26_windows_amd64.zip",
"checksum": "8E31F6D623CDC3C12D2236E1E444FAA191126434A2007F4D2BECC0D0D416469B",
"id": "github_release/github.com/rhysd/actionlint/v1.7.7/actionlint_1.7.7_windows_amd64.zip",
"checksum": "7F12F1801BCA3D480D67AAF7774F4C2A6359A3CA8EEBE382C95C10C9704AA731",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/rhysd/actionlint/v1.6.26/actionlint_1.6.26_windows_arm64.zip",
"checksum": "2545EEA6E1F02A24619514F50DCCE7543B8C0028B50E3EFBCEC3DC79E16AE5EA",
"id": "github_release/github.com/rhysd/actionlint/v1.7.7/actionlint_1.7.7_windows_arm64.zip",
"checksum": "76E9514CFAC18E5677AA04F3A89873C981F16A2F2353BB97372A86CD09B1F5A8",
"algorithm": "sha256"
},
{
Expand Down Expand Up @@ -175,6 +175,36 @@
"checksum": "D38EC5FDEDB06FB20A485C3DB0B44C3127B01A05141E5701DB6A70201CE2D701",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/suzuki-shunsuke/nllint/v0.1.0/nllint_darwin_amd64.tar.gz",
"checksum": "C576EC52A5777255C074B0C20CDCD83060E4E502BC1FEA05EE8B149B35A0867F",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/suzuki-shunsuke/nllint/v0.1.0/nllint_darwin_arm64.tar.gz",
"checksum": "336ACCC20169D49EBA7DDBCF030758BE2DC6655BC3EC2F2AC03DE833CE35492E",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/suzuki-shunsuke/nllint/v0.1.0/nllint_linux_amd64.tar.gz",
"checksum": "8AB2CB63A60CCD8FDC9E0F71B7FD2D9B7374054DEA5F8AE63DD2E3E7D233686D",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/suzuki-shunsuke/nllint/v0.1.0/nllint_linux_arm64.tar.gz",
"checksum": "F51B84DCA69C8AECD992C606D23F735EC37BE692CEF2E895270B8E72B84183C4",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/suzuki-shunsuke/nllint/v0.1.0/nllint_windows_amd64.zip",
"checksum": "F603D6EDD76AB44C1C710A2B1E50905D444C9EFFA848BFB537CA4A1ABD93A20D",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/suzuki-shunsuke/nllint/v0.1.0/nllint_windows_arm64.zip",
"checksum": "4AEB83825367044C345128D34E38470AB53BED2D76491FB6F8A6737EC619DB90",
"algorithm": "sha256"
},
{
"id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.303.0/registry.yaml",
"checksum": "A27A66FAAB4178DD37D964AF4895AB17E8A7A2EA02EE7D67A8DF9EA8F5F46B6C01E6DC57A50B1014D0B6995F69D251D144914D29EF433A71CD82D1463C7555D9",
Expand Down
2 changes: 1 addition & 1 deletion aqua/imports/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packages:
- name: rhysd/actionlint@v1.6.26
- name: rhysd/actionlint@v1.7.7
2 changes: 2 additions & 0 deletions aqua/imports/nllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- name: suzuki-shunsuke/[email protected]

0 comments on commit 404bbc9

Please sign in to comment.