Skip to content

Commit 3350b9b

Browse files
committed
fix(actions): use go script for auto checklist updates (#166)
1 parent 9970f64 commit 3350b9b

4 files changed

Lines changed: 256 additions & 113 deletions

File tree

.github/workflows/auto-check-workflow.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Initialise Repo
22
on:
3-
create:
3+
push:
44
branches:
55
# NB: its difficult to get the default branch dynamically in
66
# push event, so it has been hardcoded.
@@ -28,7 +28,7 @@ jobs:
2828
- name: Configure Git
2929
run: |
3030
git config --global user.name "${GITHUB_ACTOR}"
31-
git config --global user.email "${GITHUB_ACTOR_EMAIL}"
31+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
3232
shell: bash
3333

3434
- name: Checkout
@@ -38,26 +38,35 @@ jobs:
3838

3939
- name: Run script
4040
run: |
41-
. ./scripts/automate-checklist.sh
42-
auto-check
41+
go run ./scripts/automate-checklist.go
4342
shell: bash
4443

4544
- name: Go Format
4645
run: |
4746
go fmt ./...
4847
shell: bash
4948

49+
- name: Go Mod Tidy
50+
run: |
51+
go mod tidy
52+
shell: bash
53+
5054
- name: Clean up redundant scripts
5155
run: |
5256
rm -fv .github/workflows/auto-check-workflow.yml 2>/dev/null
5357
rm -fv ./scripts/automate-checklist.sh 2>/dev/null
58+
rm -fv ./scripts/automate-checklist.go 2>/dev/null
5459
shell: bash
5560

5661
- name: Add files and commit changes
5762
run: |
5863
git add .
59-
git commit -m "chore(gh-actions): apply auto-check edits"
60-
git push -u origin ${{ github.event.repository.default_branch }}
64+
if [ -n "$(git status --porcelain)" ]; then
65+
git commit -m "chore(gh-actions): apply auto-check edits"
66+
git push -u origin ${{ github.event.repository.default_branch }}
67+
else
68+
echo "No changes to commit"
69+
fi
6170
shell: bash
6271
env:
6372
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

go.mod

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,29 @@ require (
1616

1717
require (
1818
github.com/Masterminds/semver/v3 v3.4.0 // indirect
19-
github.com/chzyer/readline v1.5.1 // indirect
2019
github.com/go-logr/logr v1.4.3 // indirect
2120
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
2221
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
2322
github.com/google/go-cmp v0.7.0 // indirect
2423
github.com/google/pprof v0.0.0-20260302011040-a15ffb7f9dcc // indirect
25-
github.com/ianlancetaylor/demangle v0.0.0-20251118225945-96ee0021ea0f // indirect
2624
github.com/nxadm/tail v1.4.11 // indirect
2725
github.com/onsi/ginkgo v1.16.5 // indirect
2826
github.com/sagikazarmark/locafero v0.12.0 // indirect
29-
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
30-
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
3127
go.uber.org/multierr v1.11.0 // indirect
3228
go.yaml.in/yaml/v3 v3.0.4 // indirect
3329
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
3430
golang.org/x/mod v0.33.0 // indirect
3531
golang.org/x/sync v0.20.0 // indirect
3632
golang.org/x/tools v0.42.0 // indirect
33+
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
3734
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
38-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
3935
gopkg.in/yaml.v2 v2.4.0 // indirect
4036
)
4137

4238
require (
4339
github.com/cubiest/jibberjabber v1.0.1
4440
github.com/fsnotify/fsnotify v1.9.0 // indirect
45-
github.com/hashicorp/hcl v1.0.0 // indirect
4641
github.com/inconshreveable/mousetrap v1.1.0 // indirect
47-
github.com/magiconair/properties v1.8.10 // indirect
48-
github.com/mitchellh/mapstructure v1.5.0 // indirect
4942
github.com/natefinch/lumberjack v2.0.0+incompatible
5043
github.com/nicksnyder/go-i18n/v2 v2.6.1
5144
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
@@ -57,6 +50,4 @@ require (
5750
golang.org/x/net v0.51.0 // indirect
5851
golang.org/x/sys v0.42.0 // indirect
5952
golang.org/x/text v0.34.0
60-
gopkg.in/ini.v1 v1.67.1 // indirect
61-
gopkg.in/yaml.v3 v3.0.1 // indirect
6253
)

0 commit comments

Comments
 (0)