|
1 | 1 | # |
2 | | -# ___ _ _ |
3 | | -# / _ \ | | (_) |
4 | | -# | |_| | __ _ ___ _ __ | |_ _ ___ |
| 2 | +# ___ _ _ |
| 3 | +# / _ \ | | (_) |
| 4 | +# | |_| | __ _ ___ _ __ | |_ _ ___ |
5 | 5 | # | _ |/ _` |/ _ \ '_ \| __| |/ __| |
6 | | -# | | | | (_| | __/ | | | |_| | (__ |
| 6 | +# | | | | (_| | __/ | | | |_| | (__ |
7 | 7 | # \_| |_/\__, |\___|_| |_|\__|_|\___| |
8 | 8 | # __/ | |
9 | | -# _ _ |___/ |
| 9 | +# _ _ |___/ |
10 | 10 | # | | | | / _| | |
11 | 11 | # | | | | ___ _ __ _ __| |_| | _____ ____ |
12 | 12 | # | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___| |
13 | 13 | # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ |
14 | 14 | # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ |
15 | 15 | # |
16 | | -# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.51.2). DO NOT EDIT. |
| 16 | +# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.55.0). DO NOT EDIT. |
17 | 17 | # |
18 | 18 | # To regenerate this workflow, run: |
19 | 19 | # gh aw compile |
|
23 | 23 | # |
24 | 24 | # Alternative regeneration methods: |
25 | 25 | # make recompile |
26 | | -# |
| 26 | +# |
27 | 27 | # Or use the gh-aw CLI directly: |
28 | 28 | # ./gh-aw compile --validate --verbose |
29 | | -# |
| 29 | +# |
30 | 30 | # The workflow is generated when any workflow uses the 'expires' field |
31 | 31 | # in create-discussions, create-issues, or create-pull-request safe-outputs configuration. |
32 | 32 | # Schedule frequency is automatically determined by the shortest expiration time. |
|
37 | 37 | schedule: |
38 | 38 | - cron: "37 */2 * * *" # Every 2 hours (based on minimum expires: 1 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: |
45 | | - if: ${{ !github.event.repository.fork }} |
| 57 | + if: ${{ !github.event.repository.fork && (github.event_name != 'workflow_dispatch' || github.event.inputs.operation == '') }} |
46 | 58 | runs-on: ubuntu-slim |
47 | 59 | permissions: |
48 | 60 | discussions: write |
49 | 61 | issues: write |
50 | 62 | pull-requests: write |
51 | 63 | steps: |
52 | 64 | - name: Setup Scripts |
53 | | - uses: github/gh-aw/actions/setup@cccf96100f50705c4291b91a6071c556f72cb3ef # v0.51.2 |
| 65 | + uses: github/gh-aw/actions/setup@e211c855a20aa6cf9297b411466e1c382a8686db # v0.55.0 |
54 | 66 | with: |
55 | 67 | destination: /opt/gh-aw/actions |
56 | 68 |
|
|
80 | 92 | setupGlobals(core, github, context, exec, io); |
81 | 93 | const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs'); |
82 | 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@e211c855a20aa6cf9297b411466e1c382a8686db # v0.55.0 |
| 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.55.0 |
| 126 | + with: |
| 127 | + version: v0.55.0 |
| 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