Debian Codegraph @

.github/workflows/labels.yml

raw
1 name: Sync Labels
2
3 on:
4 # NOTE: github.event is workflow_dispatch payload:
5 # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch
6 workflow_dispatch:
7 inputs:
8 delete-unmapped:
9 description: Delete labels not mapped in either global or local label configurations.
10 default: false
11 type: boolean
12
13 dry-run:
14 description: Run label synchronization workflow without making any changes.
15 default: false
16 type: boolean
17
18 concurrency:
19 group: ${{ github.workflow }}-${{ github.repository }}
20 cancel-in-progress: true
21
22 permissions:
23 contents: read
24
25 jobs:
26 sync:
27 name: Sync labels
28 if: '!github.event.repository.fork'
29 runs-on: ubuntu-slim
30 permissions:
31 contents: read
32 issues: write # Required to create, update, and delete repository issue labels.
33 env:
34 GLOBAL: https://raw.githubusercontent.com/conda/infra/main/.github/global.yml
35 LOCAL: .github/labels.yml
36 steps:
37 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
38 with:
39 persist-credentials: false
40
41 - id: has_local
42 uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
43 with:
44 files: ${{ env.LOCAL }}
45
46 - name: Global Only
47 uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3
48 if: steps.has_local.outputs.files_exists == 'false'
49 with:
50 config-file: ${{ env.GLOBAL }}
51 delete-other-labels: ${{ inputs.delete-unmapped }}
52 dry-run: ${{ inputs.dry-run }}
53
54 - name: Global & Local
55 uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3
56 if: steps.has_local.outputs.files_exists == 'true'
57 with:
58 config-file: |
59 ${{ env.GLOBAL }}
60 ${{ env.LOCAL }}
61 delete-other-labels: ${{ inputs.delete-unmapped }}
62 dry-run: ${{ inputs.dry-run }}