Repository navigation
60 lines (56 loc) · 1.89 KB
/
Copy pathpr_check_git_status.yml
File metadata and controls
60 lines (56 loc) · 1.89 KB
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
name: "PR: Check git status"
on:
push:
branches:
- "tlim_testpr"
pull_request:
concurrency:
# Cancel superseded runs when new commits are pushed to the same PR/branch.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
go-checks:
# Consolidated Go checks: one checkout + one setup-go, so the Go module and
# build cache are warmed once and reused across every command below.
# A single git-status check verifies none of the commands changed tracked files.
name: "Check: go (build/fmtjson/mod-tidy/generate/fmt/fix)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-go@v7
with:
go-version: "stable"
# `go build` also warms the module + build cache for the commands below.
- run: go build -o dnscontrol .
- run: bin/fmtjson-all.sh
- run: go mod tidy
- run: go generate ./...
- run: go fmt ./...
- run: go fix ./...
- uses: CatChen/check-git-status-action@v2
with:
fail-if-not-clean: true
request-changes-if-not-clean: false
prettier:
name: "Check: prettier"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v7
with:
node-version: latest
- run: npm install
- run: node_modules/.bin/prettier --write pkg/js/helpers.js
- run: git checkout -- package-lock.json
- uses: CatChen/check-git-status-action@v2
with:
fail-if-not-clean: true
request-changes-if-not-clean: false