Skip to content

Commit 865a679

Browse files
ci: remove a create-status-check workflow (#1158)
* ci: remove a create-status-check workflow - suzuki-shunsuke/batch-task#4 * ci: use autofix.ci * [autofix.ci] apply automated fixes * fix: add help-all command * ci: update go-test-workflow --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 9cca60d commit 865a679

9 files changed

+132
-295
lines changed

.github/workflows/autofix.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: autofix.ci
3+
on: pull_request
4+
permissions: {}
5+
jobs:
6+
autofix:
7+
runs-on: ubuntu-24.04
8+
permissions: {}
9+
timeout-minutes: 15
10+
steps:
11+
- uses: suzuki-shunsuke/go-autofix-action@559f0cb21668a975222826fa376dbec951abc2f6 # v0.1.4
12+
with:
13+
aqua_version: v2.46.0
14+
- run: npm i -g prettier
15+
- run: prettier -w .
16+
- uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1

.github/workflows/create-status-check.yaml

-15
This file was deleted.

.github/workflows/test.yaml

+8-114
Original file line numberDiff line numberDiff line change
@@ -2,127 +2,21 @@
22
name: test
33
on: pull_request
44
permissions: {}
5-
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
68
jobs:
7-
path-filter:
8-
# Get changed files to filter jobs
9-
timeout-minutes: 30
10-
outputs:
11-
update-aqua-checksums: ${{steps.changes.outputs.update-aqua-checksums}}
12-
renovate-config-validator: ${{steps.changes.outputs.renovate-config-validator}}
13-
ghalint: ${{steps.changes.outputs.ghalint}}
14-
runs-on: ubuntu-latest
15-
permissions: {}
16-
steps:
17-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
18-
id: changes
19-
with:
20-
filters: |
21-
update-aqua-checksums:
22-
- aqua.yaml
23-
- aqua/*.yaml
24-
- aqua-checksums.json
25-
- .github/workflows/test.yaml
26-
renovate-config-validator:
27-
- renovate.json5
28-
ghalint:
29-
- .github/workflows/*.yaml
30-
- aqua/ghalint.yaml
31-
32-
ghalint:
33-
# Validate GitHub Actions Workflows by ghalint.
34-
timeout-minutes: 30
35-
needs: path-filter
36-
if: needs.path-filter.outputs.ghalint == 'true'
37-
runs-on: ubuntu-latest
38-
permissions: {}
39-
steps:
40-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41-
with:
42-
persist-credentials: false
43-
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
44-
with:
45-
aqua_version: v2.46.0
46-
env:
47-
AQUA_GITHUB_TOKEN: ${{github.token}}
48-
- run: ghalint run
49-
env:
50-
GHALINT_LOG_COLOR: always
51-
52-
update-aqua-checksums:
53-
# Update aqua-checksums.json and push a commit
54-
needs: path-filter
55-
permissions:
56-
contents: read # The reusable workflow requires contents:read
57-
if: |
58-
needs.path-filter.outputs.update-aqua-checksums == 'true'
59-
uses: aquaproj/update-checksum-workflow/.github/workflows/update-checksum.yaml@8bce60cc4475128360bc32f00707abb874ca4a91 # v1.0.3
60-
with:
61-
aqua_version: v2.46.0
62-
prune: true
63-
secrets:
64-
gh_app_id: ${{secrets.APP_ID}}
65-
gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}}
66-
67-
renovate-config-validator:
68-
# Validate Renovate Configuration by renovate-config-validator.
69-
uses: suzuki-shunsuke/renovate-config-validator-workflow/.github/workflows/validate.yaml@e8effbd185cbe3874cddef63f48b8bdcfc9ada55 # v0.2.4
70-
needs: path-filter
71-
if: needs.path-filter.outputs.renovate-config-validator == 'true'
72-
permissions:
73-
contents: read
74-
75-
enable-automerge:
76-
# Enable automerge to merge pull requests from Renovate automatically.
77-
timeout-minutes: 30
78-
runs-on: ubuntu-latest
79-
needs:
80-
- status-check
81-
permissions:
82-
contents: write # For enable automerge
83-
pull-requests: write # For enable automerge
84-
# "! failure() && ! cancelled()" is required. success() returns false if dependent jobs are skipped. https://github.com/community/community/discussions/45058
85-
# By default success() is used so we have to override success() by "! failure() && ! cancelled()"
86-
if: |
87-
! failure() && ! cancelled() && github.event.pull_request.user.login == 'renovate[bot]' && contains(github.event.pull_request.body, ' **Automerge**: Enabled.')
88-
steps:
89-
- uses: suzuki-shunsuke/enable-auto-merge-action@ec074392e76cd1062925255cd82a86ea1c44b6fd # v0.1.0
90-
with:
91-
pr_number: ${{github.event.pull_request.number}}
92-
merge_method: squash
93-
github_app_id: ${{secrets.APP_ID}}
94-
github_app_private_key: ${{secrets.APP_PRIVATE_KEY}}
95-
969
status-check:
97-
# This job is used for main branch's branch protection rule's status check.
98-
# If all dependent jobs succeed or are skipped this job succeeds.
99-
timeout-minutes: 30
100-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
11+
if: failure()
12+
timeout-minutes: 10
13+
permissions: {}
10114
needs:
102-
- update-aqua-checksums
10315
- test
104-
- ghalint
105-
- renovate-config-validator
106-
permissions: {}
107-
if: failure()
10816
steps:
10917
- run: exit 1
110-
11118
test:
112-
uses: suzuki-shunsuke/go-test-workflow/.github/workflows/test.yaml@6861ea245ad10752afcba66cb71f28cf5c46ce49 # v1.1.0
113-
with:
114-
aqua_version: v2.46.0
115-
go-version-file: go.mod
19+
uses: ./.github/workflows/workflow_call_test.yaml
11620
permissions:
11721
pull-requests: write
11822
contents: read
119-
120-
prettier:
121-
timeout-minutes: 30
122-
runs-on: ubuntu-latest
123-
steps:
124-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
125-
with:
126-
persist-credentials: false
127-
- run: npm i -g prettier
128-
- run: prettier -c .
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: test (workflow_call)
3+
on: workflow_call
4+
permissions: {}
5+
jobs:
6+
path-filter:
7+
# Get changed files to filter jobs
8+
timeout-minutes: 10
9+
outputs:
10+
renovate-config-validator: ${{steps.changes.outputs.renovate-config-validator}}
11+
ghalint: ${{steps.changes.outputs.ghalint}}
12+
runs-on: ubuntu-latest
13+
permissions: {}
14+
steps:
15+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
16+
id: changes
17+
with:
18+
filters: |
19+
renovate-config-validator:
20+
- renovate.json5
21+
ghalint:
22+
- .github/workflows/*.yaml
23+
- aqua/ghalint.yaml
24+
25+
ghalint:
26+
# Validate GitHub Actions Workflows by ghalint.
27+
timeout-minutes: 15
28+
needs: path-filter
29+
if: needs.path-filter.outputs.ghalint == 'true'
30+
runs-on: ubuntu-latest
31+
permissions: {}
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
with:
35+
persist-credentials: false
36+
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
37+
with:
38+
aqua_version: v2.46.0
39+
env:
40+
AQUA_GITHUB_TOKEN: ${{github.token}}
41+
- run: ghalint run
42+
env:
43+
GHALINT_LOG_COLOR: always
44+
45+
renovate-config-validator:
46+
# Validate Renovate Configuration by renovate-config-validator.
47+
uses: suzuki-shunsuke/renovate-config-validator-workflow/.github/workflows/validate.yaml@e8effbd185cbe3874cddef63f48b8bdcfc9ada55 # v0.2.4
48+
needs: path-filter
49+
if: needs.path-filter.outputs.renovate-config-validator == 'true'
50+
permissions:
51+
contents: read
52+
53+
test:
54+
uses: suzuki-shunsuke/go-test-workflow/.github/workflows/test.yaml@287a75bd5ffae8d64db887708d9262381a7f6655 # v1.1.1
55+
with:
56+
aqua_version: v2.46.0
57+
go-version-file: go.mod
58+
permissions:
59+
pull-requests: write
60+
contents: read

USAGE.md

-1
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,3 @@ DESCRIPTION:
171171
if command -v aqua-registry &> /dev/null; then source <(aqua-registry completion zsh); fi
172172
173173
```
174-

generate-usage.sh

+5-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
#!/usr/bin/env bash
22

33
set -eu
4-
set -o pipefail
54

6-
command_console() {
7-
echo '```console'
8-
echo "$ $*"
9-
"$@"
10-
echo '```'
11-
}
5+
cd "$(dirname "$0")"
126

13-
commands() {
14-
for cmd in scaffold create-pr-new-pkg init generate-registry patch-checksum completion; do
15-
echo "
16-
## aqua-registry $cmd
7+
help=$(aqua-registry help-all)
178

18-
$(command_console aqua-registry help $cmd)"
19-
done
20-
}
9+
echo -n "# Usage
2110
22-
echo "# Usage
11+
<!-- This is generated by scripts/generate-usage.sh. Don't edit this file directly. -->
2312
24-
<!-- This is generated by generate-usage.sh. Don't edit this file directly. -->
25-
26-
$(command_console aqua-registry help)
27-
$(commands)
28-
" > USAGE.md
13+
$help" > USAGE.md

go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/sirupsen/logrus v1.9.3
1010
github.com/spf13/afero v1.14.0
1111
github.com/suzuki-shunsuke/logrus-error v0.1.4
12+
github.com/suzuki-shunsuke/urfave-cli-help-all v0.0.4
1213
github.com/urfave/cli/v2 v2.27.6
1314
gopkg.in/yaml.v2 v2.4.0
1415
gopkg.in/yaml.v3 v3.0.1
@@ -23,9 +24,6 @@ require (
2324
github.com/buger/jsonparser v1.1.1 // indirect
2425
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
2526
github.com/expr-lang/expr v1.17.1 // indirect
26-
github.com/google/go-github/v67 v67.0.0 // indirect
27-
github.com/google/go-github/v68 v68.0.0 // indirect
28-
github.com/google/go-github/v69 v69.2.0 // indirect
2927
github.com/google/go-github/v70 v70.0.0 // indirect
3028
github.com/google/go-querystring v1.1.0 // indirect
3129
github.com/google/uuid v1.6.0 // indirect

0 commit comments

Comments
 (0)