-
-
Notifications
You must be signed in to change notification settings - Fork 102
55 lines (53 loc) · 1.86 KB
/
go_generate_update.yml
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
name: Update generated code
on:
workflow_dispatch: ~
schedule:
- cron: '0 8-18/4 * * 1-5'
jobs:
update:
name: Update generated code
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.22.0'
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Prepare
run: |
rm -rf ~/.platformsh/bin/
go generate ./
-
name: Check Git status
id: git
run: |
RESULT=$(git status --untracked-files=no --porcelain)
echo "gitstatus=$RESULT" >> $GITHUB_OUTPUT
-
name: Test
if: steps.git.outputs.gitstatus != ''
run: go test -v ./...
- name: Validate build
if: steps.git.outputs.gitstatus != ''
run: go run .
-
name: Commit and push the update
if: steps.git.outputs.gitstatus != ''
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add local/platformsh/commands.go local/platformsh/config.go
git commit -m "chore: Update supported Platform.sh services"
git push