Skip to content

Commit 211f883

Browse files
ci: made workflow more verbose, and listed out versions
I am doing this because the workflow does not seem to work on GitHub, but works locally. I expect myself to have newer versions of the packages in question.
1 parent dec70ff commit 211f883

File tree

2 files changed

+73
-59
lines changed

2 files changed

+73
-59
lines changed

.github/labels.yaml

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,94 +3,94 @@
33

44
# ~ Standard GitHub labels ~ #
55

6-
- name: duplicate
7-
color: cfd3d7
8-
description: This issue or pull request already exists
6+
- name: "duplicate"
7+
color: "cfd3d7"
8+
description: "This issue or pull request already exists"
99
type: false
1010

11-
- name: not planned
12-
color: ffffff
13-
description: This will not be worked on
11+
- name: "not planned"
12+
color: "ffffff"
13+
description: "This will not be worked on"
1414
type: false
1515

16-
- name: invalid
17-
color: e4e669
18-
description: This doesn't seem right.
16+
- name: "invalid"
17+
color: "e4e669"
18+
description: "This doesn't seem right."
1919
type: false
2020

21-
- name: stale
22-
color: ff1616
23-
description: No progress or activity.
21+
- name: "stale"
22+
color: "ff1616"
23+
description: "No progress or activity."
2424
type: false
2525

26-
- name: ai spam
27-
color: ffFFff
28-
description: Maybe just don't do that.
26+
- name: "ai spam"
27+
color: "ffFFff"
28+
description: "Maybe just don't do that."
2929
type: false
3030

3131
# ~ Conventional commits ~ #
3232

33-
- name: BREAKING CHANGE
34-
color: FF0000
35-
description: A breaking change
33+
- name: "BREAKING CHANGE"
34+
color: "FF0000"
35+
description: "A breaking change"
3636
type: false
3737

38-
- name: build
39-
color: 264603
40-
description: Changes that affect the build system or dependencies
38+
- name: "build"
39+
color: "264603"
40+
description: "Changes that affect the build system or dependencies"
4141
type: true
4242

43-
- name: chore
44-
color: D4C5F9
45-
description: A change that does not change functionality
43+
- name: "chore"
44+
color: "D4C5F9"
45+
description: "A change that does not change functionality"
4646
type: true
4747

48-
- name: ci
49-
color: 7057FF
50-
description: Changes to CI configuration or scripts
48+
- name: "ci"
49+
color: "7057FF"
50+
description: "Changes to CI configuration or scripts"
5151
type: true
5252

53-
- name: deps
54-
color: 0366D6
55-
description: Dependency updates or changes
53+
- name: "deps"
54+
color: "0366D6"
55+
description: "Dependency updates or changes"
5656
type: true
5757

58-
- name: docs
59-
color: a27b59
60-
description: Documentation-only changes
58+
- name: "docs"
59+
color: "a27b59"
60+
description: "Documentation-only changes"
6161
type: true
6262

63-
- name: feat
64-
color: A2EEEF
65-
description: New feature or request for one
63+
- name: "feat"
64+
color: "A2EEEF"
65+
description: "New feature or request for one"
6666
type: true
6767

68-
- name: fix
69-
color: D73A4A
70-
description: A fix or report for something that isn't working
68+
- name: "fix"
69+
color: "D73A4A"
70+
description: "A fix or report for something that isn't working"
7171
type: true
7272

73-
- name: perf
74-
color: 0E8A16
75-
description: Performance improvements
73+
- name: "perf"
74+
color: "0E8A16"
75+
description: "Performance improvements"
7676
type: true
7777

78-
- name: refactor
79-
color: C5DEF5
80-
description: Code change that neither fixes a bug nor adds a feature
78+
- name: "refactor"
79+
color: "C5DEF5"
80+
description: "Code change that neither fixes a bug nor adds a feature"
8181
type: true
8282

83-
- name: revert
84-
color: E99695
85-
description: Reverts a previous change
83+
- name: "revert"
84+
color: "E99695"
85+
description: "Reverts a previous change"
8686
type: true
8787

88-
- name: style
89-
color: FEF2C0
90-
description: Code style or formatting changes
88+
- name: "style"
89+
color: "FEF2C0"
90+
description: "Code style or formatting changes"
9191
type: true
9292

93-
- name: test
94-
color: FBCA04
95-
description: Adding or updating tests
93+
- name: "test"
94+
color: "FBCA04"
95+
description: "Adding or updating tests"
9696
type: true

.github/workflows/push--sync-labels.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,51 @@ jobs:
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/[email protected]
24+
- name: list dependency versions
25+
run: |
26+
echo "$(gh --version | head -1)"
27+
echo "$(yq --version | head -1)"
28+
echo "$(jq --version | head -1)"
29+
echo "$("$SHELL" --version | head -1)"
2430
- name: Sync labels with '.github/labels.yaml'
2531
env:
2632
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2733
run: |
34+
echo "Started deletion phase:"
2835
29-
desired_labels=$(yq '.' .github/labels.yaml)
36+
desired_labels=$(yq '.' .github/labels.yaml --output-format json)
3037
current_labels=$(gh label list --json name,color,description)
3138
jq -r '.[].name' <<<"$current_labels" | while read -r label; do
39+
echo " Considering to delete label: '$label'"
3240
if ! jq -e --arg name "$label" 'map(select(.name == $name)) | length > 0' <<<"$desired_labels" >/dev/null; then
33-
echo "Deleting label: $label"
34-
gh label delete "$label" -y || true
41+
echo " The label '$label' is not in labels.yaml, deleting label."
42+
gh label delete "$label" --yes || true
43+
else
44+
echo " Label '$label' is in labels.yaml"
3545
fi
3646
done
3747
48+
echo "Finished deletion phase, proceeding to updating phase:"
49+
3850
# Create or update labels from desired_labels
3951
jq -c '.[]' <<<"$desired_labels" | while read -r label; do
4052
name=$(jq -r '.name' <<<"$label")
4153
color=$(jq -r '.color' <<<"$label")
4254
description=$(jq -r '.description' <<<"$label")
4355
56+
echo " Considering to update label: '$name'"
57+
4458
# Check if the label exists
4559
existing=$(jq -c --arg name "$name" '.[] | select(.name == $name)' <<<"$current_labels" || true)
4660
if [[ -n "$existing" ]]; then
4761
existing_color=$(jq -r '.color' <<<"$existing")
4862
existing_description=$(jq -r '.description' <<<"$existing")
4963
if [[ "$existing_color" == "$color" && "$existing_description" == "$description" ]]; then
50-
echo "Label $name is already up to date, skipping"
64+
echo " Label $name is already up to date, skipping"
5165
continue
5266
fi
5367
fi
5468
55-
echo "Syncing label: $name"
69+
echo " Syncing label: $name"
5670
gh label create "$name" --color "$color" --description "$description" --force || true
5771
done

0 commit comments

Comments
 (0)