Repository navigation
71 lines (59 loc) · 1.82 KB
/
Copy pathupdate-labels.yml
File metadata and controls
71 lines (59 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- # Repo: update GitHub labels from definitions file
# Maintain in repo: funfair-server-template
name: "Repo: Update Labels"
on:
push:
branches:
- main
paths:
- ".github/labels.yml"
- ".github/workflows/update-labels.yml"
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true
permissions:
contents: read
jobs:
update-labels-config:
runs-on: >-
${{startsWith(vars.MAINTENANCE_ENVIRONMENT, '[')
&& fromJSON(vars.MAINTENANCE_ENVIRONMENT)
|| vars.MAINTENANCE_ENVIRONMENT
|| 'ubuntu-latest'}}
steps:
- name: "Check Required Secrets"
shell: bash
run: |
if [ -z "$SOURCE_PUSH_TOKEN" ]; then
echo "::error::SOURCE_PUSH_TOKEN is required but not set"
exit 1
fi
env:
SOURCE_PUSH_TOKEN: "${{secrets.SOURCE_PUSH_TOKEN}}"
- name: "Initialise Workspace"
if: runner.environment == 'self-hosted'
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- name: "Set Active Environment"
shell: bash
run: |
{
echo "ACTIVE_RUNNER_NAME=$RUNNER_NAME"
echo "ACTIVE_HOSTNAME=$HOSTNAME"
echo "ACTIVE_USER=$USER"
} >> "$GITHUB_ENV"
- name: "Checkout Source"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
clean: true
fetch-depth: 1
- name: "Update Github label config"
uses: crazy-max/ghaction-github-labeler@548a7c3603594ec17c819e1239f281a3b801ab4d # v6.0.0
with:
github-token: "${{secrets.SOURCE_PUSH_TOKEN}}"
yaml-file: ".github/labels.yml"
skip-delete: false
dry-run: false
exclude: |
help*
*issue