-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.58 KB
/
auto-check-workflow.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
56
57
58
59
60
61
62
63
64
65
name: Initialise Repo
on:
create:
branches:
# NB: its difficult to get the default branch dynamically in
# push event, so it has been hardcoded.
# ${{ github.event.repository.default_branch }} does not
# work in this scenario.
#
- main
permissions:
contents: write
jobs:
run-script:
name: run auto-check script
# We will only run this action when this repository isn't the
# template repository
#
if: >-
${{ !github.event.repository.is_template }}
runs-on: ubuntu-latest
steps:
- name: Configure Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_EMAIL}"
shell: bash
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Run Auto Check script
run: |
. ./scripts/automate-checklist.sh
auto-check
shell: bash
- name: Go Format
run: |
go fmt ./...
shell: bash
- name: Clean up redundant scripts
run: |
rm -fv .github/workflows/auto-check-workflow.yml 2>/dev/null
rm -fv ./scripts/automate-checklist.sh 2>/dev/null
shell: bash
- name: Add files and commit changes
run: |
git checkout -b main
git push -u origin main
git add .
git commit -m "chore(gh-actions): apply auto-check edits"
git push -u origin main
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}