|
13 | 13 | # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ |
14 | 14 | # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ |
15 | 15 | # |
16 | | -# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.44.0). DO NOT EDIT. |
| 16 | +# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.53.3). DO NOT EDIT. |
17 | 17 | # |
18 | 18 | # To regenerate this workflow, run: |
19 | 19 | # gh aw compile |
|
37 | 37 | schedule: |
38 | 38 | - cron: "37 0 * * *" # Daily (based on minimum expires: 7 days) |
39 | 39 | workflow_dispatch: |
| 40 | + inputs: |
| 41 | + operation: |
| 42 | + description: 'Optional maintenance operation to run' |
| 43 | + required: false |
| 44 | + type: choice |
| 45 | + default: '' |
| 46 | + options: |
| 47 | + - '' |
| 48 | + - 'disable' |
| 49 | + - 'enable' |
| 50 | + - 'update' |
| 51 | + - 'upgrade' |
40 | 52 |
|
41 | 53 | permissions: {} |
42 | 54 |
|
43 | 55 | jobs: |
44 | 56 | close-expired-entities: |
| 57 | + if: ${{ !github.event.repository.fork && (github.event_name != 'workflow_dispatch' || github.event.inputs.operation == '') }} |
45 | 58 | runs-on: ubuntu-slim |
46 | 59 | permissions: |
47 | 60 | discussions: write |
48 | 61 | issues: write |
49 | 62 | pull-requests: write |
50 | 63 | steps: |
51 | 64 | - name: Setup Scripts |
52 | | - uses: github/gh-aw/actions/setup@v0.53.0 |
| 65 | + uses: github/gh-aw/actions/setup@a0ed2f46906483dcf634e8694268e4fab9b21e65 # v0.53.3 |
53 | 66 | with: |
54 | 67 | destination: /opt/gh-aw/actions |
55 | 68 |
|
|
79 | 92 | setupGlobals(core, github, context, exec, io); |
80 | 93 | const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs'); |
81 | 94 | await main(); |
| 95 | +
|
| 96 | + run_operation: |
| 97 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.operation != '' && !github.event.repository.fork }} |
| 98 | + runs-on: ubuntu-slim |
| 99 | + permissions: |
| 100 | + actions: write |
| 101 | + contents: write |
| 102 | + pull-requests: write |
| 103 | + steps: |
| 104 | + - name: Checkout repository |
| 105 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 106 | + with: |
| 107 | + persist-credentials: false |
| 108 | + |
| 109 | + - name: Setup Scripts |
| 110 | + uses: github/gh-aw/actions/setup@a0ed2f46906483dcf634e8694268e4fab9b21e65 # v0.53.3 |
| 111 | + with: |
| 112 | + destination: /opt/gh-aw/actions |
| 113 | + |
| 114 | + - name: Check admin/maintainer permissions |
| 115 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 116 | + with: |
| 117 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 118 | + script: | |
| 119 | + const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
| 120 | + setupGlobals(core, github, context, exec, io); |
| 121 | + const { main } = require('/opt/gh-aw/actions/check_team_member.cjs'); |
| 122 | + await main(); |
| 123 | +
|
| 124 | + - name: Install gh-aw |
| 125 | + uses: github/gh-aw/actions/setup-cli@v0.53.3 |
| 126 | + with: |
| 127 | + version: v0.53.3 |
| 128 | + |
| 129 | + - name: Run operation |
| 130 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 131 | + env: |
| 132 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 133 | + GH_AW_OPERATION: ${{ github.event.inputs.operation }} |
| 134 | + GH_AW_CMD_PREFIX: gh aw |
| 135 | + with: |
| 136 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 137 | + script: | |
| 138 | + const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); |
| 139 | + setupGlobals(core, github, context, exec, io); |
| 140 | + const { main } = require('/opt/gh-aw/actions/run_operation_update_upgrade.cjs'); |
| 141 | + await main(); |
0 commit comments