|
1 | | -# |
2 | 1 | # ___ _ _ |
3 | 2 | # / _ \ | | (_) |
4 | 3 | # | |_| | __ _ ___ _ __ | |_ _ ___ |
|
13 | 12 | # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ |
14 | 13 | # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ |
15 | 14 | # |
16 | | -# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.51.6). DO NOT EDIT. |
| 15 | +# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.68.3). DO NOT EDIT. |
17 | 16 | # |
18 | 17 | # To regenerate this workflow, run: |
19 | 18 | # gh aw compile |
|
37 | 36 | schedule: |
38 | 37 | - cron: "37 0 * * *" # Daily (based on minimum expires: 6 days) |
39 | 38 | workflow_dispatch: |
| 39 | + inputs: |
| 40 | + operation: |
| 41 | + description: 'Optional maintenance operation to run' |
| 42 | + required: false |
| 43 | + type: choice |
| 44 | + default: '' |
| 45 | + options: |
| 46 | + - '' |
| 47 | + - 'disable' |
| 48 | + - 'enable' |
| 49 | + - 'update' |
| 50 | + - 'upgrade' |
| 51 | + - 'safe_outputs' |
| 52 | + - 'create_labels' |
| 53 | + - 'clean_cache_memories' |
| 54 | + - 'validate' |
| 55 | + run_url: |
| 56 | + 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.' |
| 57 | + required: false |
| 58 | + type: string |
| 59 | + 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 }} |
40 | 79 |
|
41 | 80 | permissions: {} |
42 | 81 |
|
43 | 82 | jobs: |
44 | 83 | close-expired-entities: |
45 | | - if: ${{ !github.event.repository.fork }} |
| 84 | + if: ${{ (!(github.event.repository.fork)) && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }} |
46 | 85 | runs-on: ubuntu-slim |
47 | 86 | permissions: |
48 | 87 | discussions: write |
49 | 88 | issues: write |
50 | 89 | pull-requests: write |
51 | 90 | steps: |
52 | 91 | - name: Setup Scripts |
53 | | - uses: github/gh-aw/actions/setup@33cd6c7f1fee588654ef19def2e6a4174be66197 # v0.51.6 |
| 92 | + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
54 | 93 | with: |
55 | | - destination: /opt/gh-aw/actions |
| 94 | + destination: ${{ runner.temp }}/gh-aw/actions |
56 | 95 |
|
57 | 96 | - name: Close expired discussions |
58 | | - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 97 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
59 | 98 | with: |
60 | 99 | script: | |
61 | | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
62 | | - setupGlobals(core, github, context, exec, io); |
63 | | - const { main } = require('/opt/gh-aw/actions/close_expired_discussions.cjs'); |
| 100 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 101 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 102 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_discussions.cjs'); |
64 | 103 | await main(); |
65 | 104 |
|
66 | 105 | - name: Close expired issues |
67 | | - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 106 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
68 | 107 | with: |
69 | 108 | script: | |
70 | | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
71 | | - setupGlobals(core, github, context, exec, io); |
72 | | - const { main } = require('/opt/gh-aw/actions/close_expired_issues.cjs'); |
| 109 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 110 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 111 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_issues.cjs'); |
73 | 112 | await main(); |
74 | 113 |
|
75 | 114 | - name: Close expired pull requests |
76 | | - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 115 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 116 | + with: |
| 117 | + script: | |
| 118 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 119 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 120 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_pull_requests.cjs'); |
| 121 | + await main(); |
| 122 | +
|
| 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@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 131 | + with: |
| 132 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 133 | + |
| 134 | + - name: Cleanup outdated cache-memory entries |
| 135 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # 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 | +
|
| 143 | + run_operation: |
| 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)) }} |
| 145 | + runs-on: ubuntu-slim |
| 146 | + permissions: |
| 147 | + actions: write |
| 148 | + contents: write |
| 149 | + pull-requests: write |
| 150 | + outputs: |
| 151 | + operation: ${{ steps.record.outputs.operation }} |
| 152 | + steps: |
| 153 | + - name: Checkout repository |
| 154 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 155 | + with: |
| 156 | + persist-credentials: false |
| 157 | + |
| 158 | + - name: Setup Scripts |
| 159 | + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 160 | + with: |
| 161 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 162 | + |
| 163 | + - name: Check admin/maintainer permissions |
| 164 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 165 | + with: |
| 166 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 167 | + script: | |
| 168 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 169 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 170 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 171 | + await main(); |
| 172 | +
|
| 173 | + - name: Install gh-aw |
| 174 | + uses: github/gh-aw-actions/setup-cli@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 175 | + with: |
| 176 | + version: v0.68.3 |
| 177 | + |
| 178 | + - name: Run operation |
| 179 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 180 | + env: |
| 181 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 182 | + GH_AW_OPERATION: ${{ inputs.operation }} |
| 183 | + GH_AW_CMD_PREFIX: gh aw |
| 184 | + with: |
| 185 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 186 | + script: | |
| 187 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 188 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 189 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/run_operation_update_upgrade.cjs'); |
| 190 | + await main(); |
| 191 | +
|
| 192 | + - name: Record outputs |
| 193 | + id: record |
| 194 | + run: echo "operation=${{ inputs.operation }}" >> "$GITHUB_OUTPUT" |
| 195 | + |
| 196 | + apply_safe_outputs: |
| 197 | + if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'safe_outputs' && (!(github.event.repository.fork)) }} |
| 198 | + runs-on: ubuntu-slim |
| 199 | + permissions: |
| 200 | + actions: read |
| 201 | + contents: write |
| 202 | + discussions: write |
| 203 | + issues: write |
| 204 | + pull-requests: write |
| 205 | + outputs: |
| 206 | + run_url: ${{ steps.record.outputs.run_url }} |
| 207 | + steps: |
| 208 | + - name: Checkout actions folder |
| 209 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 210 | + with: |
| 211 | + sparse-checkout: | |
| 212 | + actions |
| 213 | + persist-credentials: false |
| 214 | + |
| 215 | + - name: Setup Scripts |
| 216 | + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 217 | + with: |
| 218 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 219 | + |
| 220 | + - name: Check admin/maintainer permissions |
| 221 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 222 | + with: |
| 223 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 224 | + script: | |
| 225 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 226 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 227 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 228 | + await main(); |
| 229 | +
|
| 230 | + - name: Apply Safe Outputs |
| 231 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 232 | + env: |
| 233 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 234 | + GH_AW_RUN_URL: ${{ inputs.run_url }} |
| 235 | + with: |
| 236 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 237 | + script: | |
| 238 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 239 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 240 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/apply_safe_outputs_replay.cjs'); |
| 241 | + await main(); |
| 242 | +
|
| 243 | + - name: Record outputs |
| 244 | + id: record |
| 245 | + run: echo "run_url=${{ inputs.run_url }}" >> "$GITHUB_OUTPUT" |
| 246 | + |
| 247 | + create_labels: |
| 248 | + if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'create_labels' && (!(github.event.repository.fork)) }} |
| 249 | + runs-on: ubuntu-slim |
| 250 | + permissions: |
| 251 | + contents: read |
| 252 | + issues: write |
| 253 | + steps: |
| 254 | + - name: Checkout repository |
| 255 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 256 | + with: |
| 257 | + persist-credentials: false |
| 258 | + |
| 259 | + - name: Setup Scripts |
| 260 | + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 261 | + with: |
| 262 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 263 | + |
| 264 | + - name: Check admin/maintainer permissions |
| 265 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 266 | + with: |
| 267 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 268 | + script: | |
| 269 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 270 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 271 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 272 | + await main(); |
| 273 | +
|
| 274 | + - name: Install gh-aw |
| 275 | + uses: github/gh-aw-actions/setup-cli@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 276 | + with: |
| 277 | + version: v0.68.3 |
| 278 | + |
| 279 | + - name: Create missing labels |
| 280 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 281 | + env: |
| 282 | + GH_AW_CMD_PREFIX: gh aw |
| 283 | + with: |
| 284 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 285 | + script: | |
| 286 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 287 | + setupGlobals(core, github, context, exec, io, getOctokit); |
| 288 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/create_labels.cjs'); |
| 289 | + 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@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 305 | + with: |
| 306 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 307 | + |
| 308 | + - name: Check admin/maintainer permissions |
| 309 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # 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@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 |
| 320 | + with: |
| 321 | + version: v0.68.3 |
| 322 | + |
| 323 | + - name: Validate workflows and file issue on findings |
| 324 | + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 |
| 325 | + env: |
| 326 | + GH_AW_CMD_PREFIX: gh aw |
77 | 327 | with: |
| 328 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
78 | 329 | script: | |
79 | | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
80 | | - setupGlobals(core, github, context, exec, io); |
81 | | - const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs'); |
| 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'); |
82 | 333 | await main(); |
0 commit comments