Skip to content

Commit fde60d5

Browse files
committed
YAMLisms
1 parent 0756cd3 commit fde60d5

14 files changed

+220
-172
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
version: 2
32
updates:
43
- package-ecosystem: 'npm'

.github/workflows/draft-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
name: 'Draft release'
32

4-
on: # yamllint disable-line rule:truthy
3+
on:
54
workflow_dispatch:
65
inputs:
76
version_strategy:
@@ -20,7 +19,7 @@ permissions:
2019

2120
jobs:
2221
draft-release:
23-
uses: 'google-github-actions/.github/.github/workflows/draft-release.yml@v3' # ratchet:exclude
22+
uses: 'google-github-actions/.github/.github/workflows/draft-release.yml@v3' # ratchet:exclude
2423
with:
2524
version_strategy: '${{ github.event.inputs.version_strategy }}'
2625
secrets:

.github/workflows/gemini-issue-automated-triage.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
---
21
name: '🏷️ Gemini Automated Issue Triage'
3-
on: # yamllint disable-line rule:truthy
2+
3+
on:
44
issues:
55
types:
66
- 'opened'
77
- 'reopened'
88

9+
concurrency:
10+
group: '${{ github.workflow }}-${{ github.event.issue.number }}'
11+
cancel-in-progress: true
12+
13+
defaults:
14+
run:
15+
shell: 'bash'
16+
17+
permissions:
18+
contents: 'read'
19+
id-token: 'write'
20+
issues: 'write'
21+
statuses: 'write'
22+
923
jobs:
1024
triage-issue:
1125
timeout-minutes: 5
12-
permissions:
13-
issues: 'write'
14-
contents: 'read'
15-
id-token: 'write'
16-
concurrency:
17-
group: '${{ github.workflow }}-${{ github.event.issue.number }}'
18-
# yamllint disable-line rule:truthy
19-
cancel-in-progress: true
2026
runs-on: 'ubuntu-latest'
27+
2128
steps:
2229
- name: 'Checkout repository'
23-
uses: 'actions/checkout@v4'
30+
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
2431

2532
- name: 'Generate GitHub App Token'
2633
id: 'generate_token'
27-
if: ${{ vars.APP_ID }}
28-
uses: 'actions/create-github-app-token@v1'
34+
if: |-
35+
${{ vars.APP_ID }}
36+
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2
2937
with:
3038
app-id: '${{ vars.APP_ID }}'
3139
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
@@ -43,7 +51,7 @@ jobs:
4351
OTLP_GCP_WIF_PROVIDER: '${{ vars.OTLP_GCP_WIF_PROVIDER }}'
4452
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
4553
with:
46-
settings_json: |
54+
settings_json: |-
4755
{
4856
"coreTools": [
4957
"run_shell_command(gh label list)",
@@ -55,7 +63,7 @@ jobs:
5563
},
5664
"sandbox": false
5765
}
58-
prompt: |
66+
prompt: |-
5967
## Role
6068
6169
You are an issue triage assistant. Analyze the current GitHub issue

.github/workflows/gemini-issue-scheduled-triage.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
1-
---
21
name: '📋 Gemini Scheduled Issue Triage'
32

4-
on: # yamllint disable-line rule:truthy
3+
on:
54
schedule:
6-
- cron: '0 * * * *' # Runs every hour
5+
- cron: '0 * * * *' # Runs every hour
76
workflow_dispatch:
87

8+
concurrency:
9+
group: '${{ github.workflow }}'
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
shell: 'bash'
15+
16+
permissions:
17+
contents: 'read'
18+
id-token: 'write'
19+
issues: 'write'
20+
statuses: 'write'
21+
922
jobs:
1023
triage-issues:
1124
timeout-minutes: 10
1225
runs-on: 'ubuntu-latest'
13-
permissions:
14-
contents: 'read'
15-
id-token: 'write'
16-
issues: 'write'
26+
1727
steps:
1828
- name: 'Checkout repository'
19-
uses: 'actions/checkout@v4'
29+
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
2030

2131
- name: 'Generate GitHub App Token'
2232
id: 'generate_token'
23-
if: ${{ vars.APP_ID }}
24-
uses: 'actions/create-github-app-token@v1'
33+
if: |-
34+
${{ vars.APP_ID }}
35+
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2
2536
with:
2637
app-id: '${{ vars.APP_ID }}'
2738
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
@@ -32,8 +43,7 @@ jobs:
3243
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
3344
GITHUB_REPOSITORY: '${{ github.repository }}'
3445
GITHUB_OUTPUT: '${{ github.output }}'
35-
shell: bash
36-
run: |
46+
run: |-
3747
set -euo pipefail
3848
3949
echo '🔍 Finding issues without labels...'
@@ -54,7 +64,8 @@ jobs:
5464
echo "✅ Found ${ISSUE_COUNT} issues to triage! 🎯"
5565
5666
- name: 'Run Gemini Issue Triage'
57-
if: steps.find_issues.outputs.issues_to_triage != '[]'
67+
if: |-
68+
${{ steps.find_issues.outputs.issues_to_triage != '[]' }}
5869
uses: './'
5970
env:
6071
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'
@@ -65,7 +76,7 @@ jobs:
6576
OTLP_GCP_WIF_PROVIDER: '${{ vars.OTLP_GCP_WIF_PROVIDER }}'
6677
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
6778
with:
68-
settings_json: |
79+
settings_json: |-
6980
{
7081
"coreTools": [
7182
"run_shell_command(echo)",
@@ -79,7 +90,7 @@ jobs:
7990
},
8091
"sandbox": false
8192
}
82-
prompt: |
93+
prompt: |-
8394
## Role
8495
8596
You are an issue triage assistant. Analyze issues and apply

.github/workflows/gemini-pr-review.yml

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
name: '🧐 Gemini Pull Request Review'
32

4-
on: # yamllint disable-line rule:truthy
3+
on:
54
pull_request:
65
types:
76
- 'opened'
@@ -18,9 +17,24 @@ on: # yamllint disable-line rule:truthy
1817
required: true
1918
type: 'number'
2019

20+
concurrency:
21+
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
22+
cancel-in-progress: true
23+
24+
defaults:
25+
run:
26+
shell: 'bash'
27+
28+
permissions:
29+
contents: 'read'
30+
id-token: 'write'
31+
issues: 'write'
32+
pull-requests: 'write'
33+
statuses: 'write'
34+
2135
jobs:
2236
review-pr:
23-
if: >
37+
if: |-
2438
github.event_name == 'workflow_dispatch' ||
2539
(github.event_name == 'pull_request' && github.event.action == 'opened') ||
2640
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
@@ -49,35 +63,30 @@ jobs:
4963
)
5064
timeout-minutes: 15
5165
runs-on: 'ubuntu-latest'
52-
permissions:
53-
contents: 'read'
54-
id-token: 'write'
55-
pull-requests: 'write'
56-
issues: 'write'
66+
5767
steps:
5868
- name: 'Checkout PR code'
59-
uses: 'actions/checkout@v4'
60-
with:
61-
fetch-depth: 0
69+
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
6270

6371
- name: 'Generate GitHub App Token'
6472
id: 'generate_token'
65-
if: ${{ vars.APP_ID }}
66-
uses: 'actions/create-github-app-token@v1'
73+
if: |-
74+
${{ vars.APP_ID }}
75+
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2
6776
with:
6877
app-id: '${{ vars.APP_ID }}'
6978
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
7079

7180
- name: 'Get PR details (pull_request & workflow_dispatch)'
7281
id: 'get_pr'
73-
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
82+
if: |-
83+
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
7484
env:
7585
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
76-
EVENT_NAME: "${{ github.event_name }}"
77-
WORKFLOW_PR_NUMBER: "${{ github.event.inputs.pr_number }}"
78-
PULL_REQUEST_NUMBER: "${{ github.event.pull_request.number }}"
79-
shell: bash
80-
run: |
86+
EVENT_NAME: '${{ github.event_name }}'
87+
WORKFLOW_PR_NUMBER: '${{ github.event.inputs.pr_number }}'
88+
PULL_REQUEST_NUMBER: '${{ github.event.pull_request.number }}'
89+
run: |-
8190
set -euo pipefail
8291
8392
if [[ "${EVENT_NAME}" = "workflow_dispatch" ]]; then
@@ -103,13 +112,13 @@ jobs:
103112
104113
- name: 'Get PR details (issue_comment)'
105114
id: 'get_pr_comment'
106-
if: github.event_name == 'issue_comment'
115+
if: |-
116+
${{ github.event_name == 'issue_comment' }}
107117
env:
108118
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
109-
COMMENT_BODY: "${{ github.event.comment.body }}"
110-
PR_NUMBER: "${{ github.event.issue.number }}"
111-
shell: bash
112-
run: |
119+
COMMENT_BODY: '${{ github.event.comment.body }}'
120+
PR_NUMBER: '${{ github.event.issue.number }}'
121+
run: |-
113122
set -euo pipefail
114123
115124
echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
@@ -136,17 +145,17 @@ jobs:
136145
uses: './'
137146
env:
138147
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
139-
PR_NUMBER: "${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }}"
140-
PR_DATA: "${{ steps.get_pr.outputs.pr_data || steps.get_pr_comment.outputs.pr_data }}"
141-
CHANGED_FILES: "${{ steps.get_pr.outputs.changed_files || steps.get_pr_comment.outputs.changed_files }}"
142-
ADDITIONAL_INSTRUCTIONS: "${{ steps.get_pr.outputs.additional_instructions || steps.get_pr_comment.outputs.additional_instructions }}"
143-
REPOSITORY: "${{ github.repository }}"
148+
PR_NUMBER: '${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }}'
149+
PR_DATA: '${{ steps.get_pr.outputs.pr_data || steps.get_pr_comment.outputs.pr_data }}'
150+
CHANGED_FILES: '${{ steps.get_pr.outputs.changed_files || steps.get_pr_comment.outputs.changed_files }}'
151+
ADDITIONAL_INSTRUCTIONS: '${{ steps.get_pr.outputs.additional_instructions || steps.get_pr_comment.outputs.additional_instructions }}'
152+
REPOSITORY: '${{ github.repository }}'
144153
GEMINI_CLI_VERSION: '${{ vars.GEMINI_CLI_VERSION }}'
145154
OTLP_GOOGLE_CLOUD_PROJECT: '${{ vars.OTLP_GOOGLE_CLOUD_PROJECT }}'
146155
OTLP_GCP_WIF_PROVIDER: '${{ vars.OTLP_GCP_WIF_PROVIDER }}'
147156
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
148157
with:
149-
settings_json: |
158+
settings_json: |-
150159
{
151160
"coreTools": [
152161
"run_shell_command(echo)",
@@ -165,7 +174,7 @@ jobs:
165174
},
166175
"sandbox": false
167176
}
168-
prompt: |
177+
prompt: |-
169178
## Role
170179
171180
You are an expert code reviewer. You have access to tools to gather

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
name: 'Publish immutable action version'
32

4-
on: # yamllint disable-line rule:truthy
3+
on:
54
workflow_dispatch:
65
release:
76
types:
@@ -18,10 +17,10 @@ jobs:
1817

1918
steps:
2019
- name: 'Checkout'
21-
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
20+
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
2221

2322
- name: 'Publish'
2423
id: 'publish'
25-
uses: 'actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978' # ratchet:actions/[email protected]
24+
uses: 'actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978' # ratchet:actions/[email protected]
2625
with:
2726
github-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
name: 'Release'
32

4-
on: # yamllint disable-line rule:truthy
3+
on:
54
push:
65
branches:
76
- 'main'
@@ -13,6 +12,6 @@ permissions:
1312

1413
jobs:
1514
release:
16-
uses: 'google-github-actions/.github/.github/workflows/release.yml@v3' # ratchet:exclude
15+
uses: 'google-github-actions/.github/.github/workflows/release.yml@v3' # ratchet:exclude
1716
secrets:
1817
ACTIONS_BOT_TOKEN: '${{ secrets.ACTIONS_BOT_TOKEN }}'

.github/workflows/test.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
name: 'Test'
32

4-
on: # yamllint disable-line rule:truthy
3+
on:
54
push:
65
branches:
76
- 'main'
@@ -14,7 +13,7 @@ on: # yamllint disable-line rule:truthy
1413

1514
concurrency:
1615
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
17-
cancel-in-progress: true # yamllint disable-line rule:truthy
16+
cancel-in-progress: true
1817

1918
defaults:
2019
run:
@@ -25,16 +24,11 @@ permissions:
2524
statuses: 'write'
2625

2726
jobs:
28-
yamllint:
29-
name: 'yamllint'
27+
test:
3028
runs-on: 'ubuntu-latest'
31-
permissions:
32-
contents: 'read'
33-
id-token: 'write'
3429

3530
steps:
36-
- name: 'Checkout repository'
37-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
38-
- name: Validate all YAML files
39-
run: |
40-
yamllint . --format github
31+
- name: 'Lint YAML'
32+
uses: 'abcxyz/actions/.github/actions/lint-yaml@48bf3573880bcd307661522345bbe419115c3d4b' # ratchet:abcxyz/actions/.github/actions/lint-yaml@main
33+
with:
34+
yamllint_url: 'https://raw.githubusercontent.com/google-github-actions/.github/main/.yamllint.yml'

0 commit comments

Comments
 (0)