-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (41 loc) · 1.14 KB
/
globalconfig.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
name: Update Global Config
on:
push:
branches:
- main
paths:
- 'embeddedconfig/global.yaml.tmpl'
schedule:
- cron: "0 */12 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Granting private modules access
run: |
git config --global url."https://${{ secrets.CI_PRIVATE_REPOS_GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- run: |
cd ./embeddedconfig
go generate
cd -
cd ./config
go test
cd -
git config user.name github-actions
git config user.email [email protected]
git pull
git add embeddedconfig/global.yaml
# Don't continue if there's no changes.
git diff-index --quiet HEAD && exit
git commit -m "pushing auto-generated embedded global config"
echo "pushing to main"
git push origin main