-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (35 loc) · 892 Bytes
/
main.yml
File metadata and controls
41 lines (35 loc) · 892 Bytes
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
name: Go CI
on:
push:
branches:
- main
paths:
- main.go
- go.*
- .github/workflows/**
schedule:
- cron: 10 5 * * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
- name: Compile and run main.go
run: |
go run .
- name: Commit generated files
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -u
git diff-index --quiet HEAD || git commit -a -m "[auto] Update generated files"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main