|
49 | 49 | - 'update' |
50 | 50 | - 'upgrade' |
51 | 51 | - 'safe_outputs' |
| 52 | + - 'create_labels' |
52 | 53 | run_url: |
53 | 54 | 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.' |
54 | 55 | required: false |
@@ -106,7 +107,7 @@ jobs: |
106 | 107 | await main(); |
107 | 108 |
|
108 | 109 | run_operation: |
109 | | - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.operation != '' && github.event.inputs.operation != 'safe_outputs' && !github.event.repository.fork }} |
| 110 | + 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 }} |
110 | 111 | runs-on: ubuntu-slim |
111 | 112 | permissions: |
112 | 113 | actions: write |
@@ -201,6 +202,54 @@ jobs: |
201 | 202 | const { main } = require('${{ runner.temp }}/gh-aw/actions/apply_safe_outputs_replay.cjs'); |
202 | 203 | await main(); |
203 | 204 |
|
| 205 | + create_labels: |
| 206 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.operation == 'create_labels' && !github.event.repository.fork }} |
| 207 | + runs-on: ubuntu-slim |
| 208 | + permissions: |
| 209 | + contents: read |
| 210 | + issues: write |
| 211 | + steps: |
| 212 | + - name: Checkout repository |
| 213 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 214 | + with: |
| 215 | + persist-credentials: false |
| 216 | + |
| 217 | + - name: Setup Scripts |
| 218 | + uses: ./actions/setup |
| 219 | + with: |
| 220 | + destination: ${{ runner.temp }}/gh-aw/actions |
| 221 | + |
| 222 | + - name: Check admin/maintainer permissions |
| 223 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 224 | + with: |
| 225 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 226 | + script: | |
| 227 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 228 | + setupGlobals(core, github, context, exec, io); |
| 229 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); |
| 230 | + await main(); |
| 231 | +
|
| 232 | + - name: Setup Go |
| 233 | + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 234 | + with: |
| 235 | + go-version-file: go.mod |
| 236 | + cache: true |
| 237 | + |
| 238 | + - name: Build gh-aw |
| 239 | + run: make build |
| 240 | + |
| 241 | + - name: Create missing labels |
| 242 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 |
| 243 | + env: |
| 244 | + GH_AW_CMD_PREFIX: ./gh-aw |
| 245 | + with: |
| 246 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 247 | + script: | |
| 248 | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); |
| 249 | + setupGlobals(core, github, context, exec, io); |
| 250 | + const { main } = require('${{ runner.temp }}/gh-aw/actions/create_labels.cjs'); |
| 251 | + await main(); |
| 252 | +
|
204 | 253 | compile-workflows: |
205 | 254 | if: ${{ !github.event.repository.fork && (github.event_name != 'workflow_dispatch' || github.event.inputs.operation == '') }} |
206 | 255 | runs-on: ubuntu-slim |
|
0 commit comments