|
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.47.0). DO NOT EDIT. |
| 15 | +# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.68.0). DO NOT EDIT. |
17 | 16 | # |
18 | 17 | # To regenerate this workflow, run: |
19 | 18 | # gh aw compile |
|
37 | 36 | schedule: |
38 | 37 | - cron: "37 */2 * * *" # Every 2 hours (based on minimum expires: 1 days) |
39 | 38 | workflow_dispatch: |
| 39 | + inputs: |
| 40 | + operation: |
| 41 | + description: 'Optional maintenance operation to run' |
| 42 | + required: false |
| 43 | + type: string |
| 44 | + default: '' |
| 45 | + run_url: |
| 46 | + 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.' |
| 47 | + required: false |
| 48 | + type: string |
| 49 | + default: '' |
40 | 50 |
|
41 | 51 | permissions: {} |
42 | 52 |
|
43 | 53 | jobs: |
44 | 54 | close-expired-entities: |
| 55 | + if: ${{ !github.event.repository.fork && (github.event_name != 'workflow_dispatch' || github.event.inputs.operation == '') }} |
45 | 56 | runs-on: ubuntu-slim |
46 | 57 | permissions: |
47 | 58 | discussions: write |
48 | 59 | issues: write |
49 | 60 | pull-requests: write |
50 | 61 | steps: |
51 | 62 | - name: Setup Scripts |
52 | | - uses: github/gh-aw/actions/setup@v0.47.0 |
| 63 | + uses: github/gh-aw-actions/setup@0acfb4a691fe207cd8bc982ea5cb9d750d57a702 # v0.68.0 |
53 | 64 | with: |
54 | | - destination: /opt/gh-aw/actions |
| 65 | + destination: ${{ runner.temp }}/gh-aw/actions |
55 | 66 |
|
56 | 67 | - name: Close expired discussions |
57 | 68 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
58 | 69 | with: |
59 | 70 | script: | |
60 | | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
| 71 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
61 | 72 | setupGlobals(core, github, context, exec, io); |
62 | | - const { main } = require('/opt/gh-aw/actions/close_expired_discussions.cjs'); |
| 73 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_discussions.cjs'); |
63 | 74 | await main(); |
64 | 75 |
|
65 | 76 | - name: Close expired issues |
66 | 77 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
67 | 78 | with: |
68 | 79 | script: | |
69 | | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
| 80 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
70 | 81 | setupGlobals(core, github, context, exec, io); |
71 | | - const { main } = require('/opt/gh-aw/actions/close_expired_issues.cjs'); |
| 82 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_issues.cjs'); |
72 | 83 | await main(); |
73 | 84 |
|
74 | 85 | - name: Close expired pull requests |
75 | 86 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
76 | 87 | with: |
77 | 88 | script: | |
78 | | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
| 89 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 90 | + setupGlobals(core, github, context, exec, io); |
| 91 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_pull_requests.cjs'); |
| 92 | + await main(); |
| 93 | +
|
| 94 | + run_operation: |
| 95 | + 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 }} |
| 96 | + runs-on: ubuntu-slim |
| 97 | + permissions: |
| 98 | + actions: write |
| 99 | + contents: write |
| 100 | + pull-requests: write |
| 101 | + steps: |
| 102 | + - name: Checkout repository |
| 103 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 104 | + with: |
| 105 | + persist-credentials: false |
| 106 | + |
| 107 | + - name: Setup Scripts |
| 108 | + uses: github/gh-aw-actions/setup@0acfb4a691fe207cd8bc982ea5cb9d750d57a702 # v0.68.0 |
| 109 | + with: |
| 110 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 111 | + |
| 112 | + - name: Check admin/maintainer permissions |
| 113 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 114 | + with: |
| 115 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 116 | + script: | |
| 117 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 118 | + setupGlobals(core, github, context, exec, io); |
| 119 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 120 | + await main(); |
| 121 | +
|
| 122 | + - name: Install gh-aw |
| 123 | + uses: github/gh-aw-actions/setup-cli@0acfb4a691fe207cd8bc982ea5cb9d750d57a702 # v0.68.0 |
| 124 | + with: |
| 125 | + version: v0.68.0 |
| 126 | + |
| 127 | + - name: Run operation |
| 128 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 129 | + env: |
| 130 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 131 | + GH_AW_OPERATION: ${{ github.event.inputs.operation }} |
| 132 | + GH_AW_CMD_PREFIX: gh aw |
| 133 | + with: |
| 134 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 135 | + script: | |
| 136 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 137 | + setupGlobals(core, github, context, exec, io); |
| 138 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/run_operation_update_upgrade.cjs'); |
| 139 | + await main(); |
| 140 | +
|
| 141 | + apply_safe_outputs: |
| 142 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.operation == 'safe_outputs' && !github.event.repository.fork }} |
| 143 | + runs-on: ubuntu-slim |
| 144 | + permissions: |
| 145 | + actions: read |
| 146 | + contents: write |
| 147 | + discussions: write |
| 148 | + issues: write |
| 149 | + pull-requests: write |
| 150 | + steps: |
| 151 | + - name: Checkout actions folder |
| 152 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 153 | + with: |
| 154 | + sparse-checkout: | |
| 155 | + actions |
| 156 | + persist-credentials: false |
| 157 | + |
| 158 | + - name: Setup Scripts |
| 159 | + uses: github/gh-aw-actions/setup@0acfb4a691fe207cd8bc982ea5cb9d750d57a702 # v0.68.0 |
| 160 | + with: |
| 161 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 162 | + |
| 163 | + - name: Check admin/maintainer permissions |
| 164 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 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); |
| 170 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 171 | + await main(); |
| 172 | +
|
| 173 | + - name: Apply Safe Outputs |
| 174 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 175 | + env: |
| 176 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 177 | + GH_AW_RUN_URL: ${{ github.event.inputs.run_url }} |
| 178 | + with: |
| 179 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 180 | + script: | |
| 181 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 182 | + setupGlobals(core, github, context, exec, io); |
| 183 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/apply_safe_outputs_replay.cjs'); |
| 184 | + await main(); |
| 185 | +
|
| 186 | + create_labels: |
| 187 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.operation == 'create_labels' && !github.event.repository.fork }} |
| 188 | + runs-on: ubuntu-slim |
| 189 | + permissions: |
| 190 | + contents: read |
| 191 | + issues: write |
| 192 | + steps: |
| 193 | + - name: Checkout repository |
| 194 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 195 | + with: |
| 196 | + persist-credentials: false |
| 197 | + |
| 198 | + - name: Setup Scripts |
| 199 | + uses: github/gh-aw-actions/setup@0acfb4a691fe207cd8bc982ea5cb9d750d57a702 # v0.68.0 |
| 200 | + with: |
| 201 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 202 | + |
| 203 | + - name: Check admin/maintainer permissions |
| 204 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 205 | + with: |
| 206 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 207 | + script: | |
| 208 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 209 | + setupGlobals(core, github, context, exec, io); |
| 210 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 211 | + await main(); |
| 212 | +
|
| 213 | + - name: Install gh-aw |
| 214 | + uses: github/gh-aw-actions/setup-cli@0acfb4a691fe207cd8bc982ea5cb9d750d57a702 # v0.68.0 |
| 215 | + with: |
| 216 | + version: v0.68.0 |
| 217 | + |
| 218 | + - name: Create missing labels |
| 219 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 220 | + env: |
| 221 | + GH_AW_CMD_PREFIX: gh aw |
| 222 | + with: |
| 223 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 224 | + script: | |
| 225 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
79 | 226 | setupGlobals(core, github, context, exec, io); |
80 | | - const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs'); |
| 227 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/create_labels.cjs'); |
81 | 228 | await main(); |
0 commit comments