Skip to content

Commit 7c1f24a

Browse files
committed
/.github/workflows/format.yml: fix job order
1 parent 031a5a8 commit 7c1f24a

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

.github/workflows/format.yml

+27-19
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,34 @@ on:
55
branches: [ master ]
66

77
jobs:
8+
verify:
9+
name: Verify format
10+
runs-on: ubuntu-18.04
11+
outputs:
12+
skip-format: ${{ steps.check_format.outputs.skip-format }}
13+
steps:
14+
- name: Setup Go 1.x
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: ^1.15
18+
id: go
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- name: Check all
23+
id: check_format
24+
run: |
25+
./check_repo.sh
26+
succeeded=$(echo "$?")
27+
if [ "$succeeded" -ne 0 ]; then
28+
echo "::set-output name=skip-format::true"
29+
fi
30+
env:
31+
BRANCH_NAME: ${{ github.head_ref }}
32+
CHANGE_TARGET: ${{ github.base_ref }}
833
format:
34+
needs: verify
35+
if: ${{ needs.verify.outputs.skip-format != 'true' }}
936
name: Format PR
1037
runs-on: ubuntu-18.04
1138
steps:
@@ -37,22 +64,3 @@ jobs:
3764
message: "[ga-format-pr] Run ./format_repo.sh to fix formatting"
3865
add: "."
3966
cwd: "."
40-
verify:
41-
name: Verify format
42-
runs-on: ubuntu-18.04
43-
steps:
44-
- name: Setup Go 1.x
45-
uses: actions/setup-go@v2
46-
with:
47-
go-version: ^1.15
48-
id: go
49-
- uses: actions/checkout@v2
50-
with:
51-
fetch-depth: 0
52-
- name: Check all
53-
working-directory: ./
54-
run: |
55-
./check_repo.sh
56-
env:
57-
BRANCH_NAME: ${{ github.head_ref }}
58-
CHANGE_TARGET: ${{ github.base_ref }}

0 commit comments

Comments
 (0)