1212# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
1313# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
1414#
15- # This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.68.1 ). DO NOT EDIT.
15+ # This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.68.7 ). DO NOT EDIT.
1616#
1717# To regenerate this workflow, run:
1818# gh aw compile
5050 - ' upgrade'
5151 - ' safe_outputs'
5252 - ' create_labels'
53+ - ' clean_cache_memories'
54+ - ' validate'
5355 run_url :
5456 description : ' Run URL or run ID to replay safe outputs from (e.g. https://github.com/owner/repo/actions/runs/12345 or 12345). Required when operation is safe_outputs.'
5557 required : false
5658 type : string
5759 default : ' '
60+ workflow_call :
61+ inputs :
62+ operation :
63+ description : ' Optional maintenance operation to run (disable, enable, update, upgrade, safe_outputs, create_labels, clean_cache_memories, validate)'
64+ required : false
65+ type : string
66+ default : ' '
67+ run_url :
68+ description : ' Run URL or run ID to replay safe outputs from (e.g. https://github.com/owner/repo/actions/runs/12345 or 12345). Required when operation is safe_outputs.'
69+ required : false
70+ type : string
71+ default : ' '
72+ outputs :
73+ operation_completed :
74+ description : ' The maintenance operation that was completed (empty when none ran or a scheduled job ran)'
75+ value : ${{ jobs.run_operation.outputs.operation || inputs.operation }}
76+ applied_run_url :
77+ description : ' The run URL that safe outputs were applied from'
78+ value : ${{ jobs.apply_safe_outputs.outputs.run_url }}
5879
5980permissions : {}
6081
6182jobs :
6283 close-expired-entities :
63- if : ${{ ! github.event.repository.fork && (github.event_name != 'workflow_dispatch' || github.event. inputs.operation == '') }}
84+ if : ${{ (!( github.event.repository.fork)) && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
6485 runs-on : ubuntu-slim
6586 permissions :
6687 discussions : write
6788 issues : write
6889 pull-requests : write
6990 steps :
7091 - name : Setup Scripts
71- uses : github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1
92+ uses : github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
7293 with :
7394 destination : ${{ runner.temp }}/gh-aw/actions
7495
@@ -99,21 +120,43 @@ jobs:
99120 const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_pull_requests.cjs');
100121 await main();
101122
123+ cleanup-cache-memory :
124+ if : ${{ (!(github.event.repository.fork)) && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '' || inputs.operation == 'clean_cache_memories') }}
125+ runs-on : ubuntu-slim
126+ permissions :
127+ actions : write
128+ steps :
129+ - name : Setup Scripts
130+ uses : github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
131+ with :
132+ destination : ${{ runner.temp }}/gh-aw/actions
133+
134+ - name : Cleanup outdated cache-memory entries
135+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
136+ with :
137+ script : |
138+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
139+ setupGlobals(core, github, context, exec, io, getOctokit);
140+ const { main } = require('${{ runner.temp }}/gh-aw/actions/cleanup_cache_memory.cjs');
141+ await main();
142+
102143 run_operation :
103- if : ${{ github.event_name == 'workflow_dispatch' && github.event. inputs.operation != '' && github.event. inputs.operation != 'safe_outputs' && github.event. inputs.operation != 'create_labels ' && ! github.event.repository.fork }}
144+ if : ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation != '' && inputs.operation != 'safe_outputs' && inputs.operation != 'create_labels' && inputs.operation != 'clean_cache_memories' && inputs.operation != 'validate ' && (!( github.event.repository.fork)) }}
104145 runs-on : ubuntu-slim
105146 permissions :
106147 actions : write
107148 contents : write
108149 pull-requests : write
150+ outputs :
151+ operation : ${{ steps.record.outputs.operation }}
109152 steps :
110153 - name : Checkout repository
111154 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
112155 with :
113156 persist-credentials : false
114157
115158 - name : Setup Scripts
116- uses : github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1
159+ uses : github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
117160 with :
118161 destination : ${{ runner.temp }}/gh-aw/actions
119162
@@ -128,15 +171,15 @@ jobs:
128171 await main();
129172
130173 - name : Install gh-aw
131- uses : github/gh-aw-actions/setup-cli@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1
174+ uses : github/gh-aw-actions/setup-cli@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
132175 with :
133- version : v0.68.1
176+ version : v0.68.7
134177
135178 - name : Run operation
136179 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
137180 env :
138181 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139- GH_AW_OPERATION : ${{ github.event. inputs.operation }}
182+ GH_AW_OPERATION : ${{ inputs.operation }}
140183 GH_AW_CMD_PREFIX : gh aw
141184 with :
142185 github-token : ${{ secrets.GITHUB_TOKEN }}
@@ -146,15 +189,21 @@ jobs:
146189 const { main } = require('${{ runner.temp }}/gh-aw/actions/run_operation_update_upgrade.cjs');
147190 await main();
148191
192+ - name : Record outputs
193+ id : record
194+ run : echo "operation=${{ inputs.operation }}" >> "$GITHUB_OUTPUT"
195+
149196 apply_safe_outputs :
150- if : ${{ github.event_name == 'workflow_dispatch' && github.event. inputs.operation == 'safe_outputs' && ! github.event.repository.fork }}
197+ if : ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'safe_outputs' && (!( github.event.repository.fork)) }}
151198 runs-on : ubuntu-slim
152199 permissions :
153200 actions : read
154201 contents : write
155202 discussions : write
156203 issues : write
157204 pull-requests : write
205+ outputs :
206+ run_url : ${{ steps.record.outputs.run_url }}
158207 steps :
159208 - name : Checkout actions folder
160209 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -164,7 +213,7 @@ jobs:
164213 persist-credentials : false
165214
166215 - name : Setup Scripts
167- uses : github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1
216+ uses : github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
168217 with :
169218 destination : ${{ runner.temp }}/gh-aw/actions
170219
@@ -182,7 +231,7 @@ jobs:
182231 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
183232 env :
184233 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185- GH_AW_RUN_URL : ${{ github.event. inputs.run_url }}
234+ GH_AW_RUN_URL : ${{ inputs.run_url }}
186235 with :
187236 github-token : ${{ secrets.GITHUB_TOKEN }}
188237 script : |
@@ -191,8 +240,12 @@ jobs:
191240 const { main } = require('${{ runner.temp }}/gh-aw/actions/apply_safe_outputs_replay.cjs');
192241 await main();
193242
243+ - name : Record outputs
244+ id : record
245+ run : echo "run_url=${{ inputs.run_url }}" >> "$GITHUB_OUTPUT"
246+
194247 create_labels :
195- if : ${{ github.event_name == 'workflow_dispatch' && github.event. inputs.operation == 'create_labels' && ! github.event.repository.fork }}
248+ if : ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'create_labels' && (!( github.event.repository.fork)) }}
196249 runs-on : ubuntu-slim
197250 permissions :
198251 contents : read
@@ -204,7 +257,7 @@ jobs:
204257 persist-credentials : false
205258
206259 - name : Setup Scripts
207- uses : github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1
260+ uses : github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
208261 with :
209262 destination : ${{ runner.temp }}/gh-aw/actions
210263
@@ -219,9 +272,9 @@ jobs:
219272 await main();
220273
221274 - name : Install gh-aw
222- uses : github/gh-aw-actions/setup-cli@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1
275+ uses : github/gh-aw-actions/setup-cli@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
223276 with :
224- version : v0.68.1
277+ version : v0.68.7
225278
226279 - name : Create missing labels
227280 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
@@ -234,3 +287,47 @@ jobs:
234287 setupGlobals(core, github, context, exec, io, getOctokit);
235288 const { main } = require('${{ runner.temp }}/gh-aw/actions/create_labels.cjs');
236289 await main();
290+
291+ validate_workflows :
292+ if : ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'validate' && (!(github.event.repository.fork)) }}
293+ runs-on : ubuntu-latest
294+ permissions :
295+ contents : read
296+ issues : write
297+ steps :
298+ - name : Checkout repository
299+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
300+ with :
301+ persist-credentials : false
302+
303+ - name : Setup Scripts
304+ uses : github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
305+ with :
306+ destination : ${{ runner.temp }}/gh-aw/actions
307+
308+ - name : Check admin/maintainer permissions
309+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
310+ with :
311+ github-token : ${{ secrets.GITHUB_TOKEN }}
312+ script : |
313+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
314+ setupGlobals(core, github, context, exec, io, getOctokit);
315+ const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs');
316+ await main();
317+
318+ - name : Install gh-aw
319+ uses : github/gh-aw-actions/setup-cli@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
320+ with :
321+ version : v0.68.7
322+
323+ - name : Validate workflows and file issue on findings
324+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
325+ env :
326+ GH_AW_CMD_PREFIX : gh aw
327+ with :
328+ github-token : ${{ secrets.GITHUB_TOKEN }}
329+ script : |
330+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
331+ setupGlobals(core, github, context, exec, io, getOctokit);
332+ const { main } = require('${{ runner.temp }}/gh-aw/actions/run_validate_workflows.cjs');
333+ await main();
0 commit comments