-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (50 loc) · 1.92 KB
/
common-ci.yml
File metadata and controls
61 lines (50 loc) · 1.92 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
61
name: common-ci
on: [workflow_call]
jobs:
buildifier:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install
run: |
BUILDIFIER_URL=https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-amd64
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 3 -O buildifier "$BUILDIFIER_URL"
chmod +x buildifier
- name: Check
run: ./buildifier --lint=warn --warnings=all -mode diff $(find . -type f -name "WORKSPACE" -or -name "BUILD.*" -or -name "*.BUILD" -or -name "*.bazel")
restyled:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: restyled-io/actions/setup@v4
- id: restyler
uses: restyled-io/actions/run@v4
- name: Copy patch to staged artifact
if: ${{ steps.restyler.outputs.git-patch }}
run: |
cat >>/tmp/restyled.diff <<'EOM'
${{ steps.restyler.outputs.git-patch }}
EOM
- id: upload
uses: actions/upload-artifact@v6
with:
path: /tmp/restyled.diff
if-no-files-found: ignore
overwrite: true
- name: Print patch instructions
if: ${{ steps.upload.outputs.artifact-url }}
run: |
cat >>"$GITHUB_STEP_SUMMARY" <<'EOM'
## Restyled
To apply these fixes locally, either:
Download '${{ steps.upload.outputs.artifact-url }}' with the web browser
$ cat restyled.diff.zip | unzip -p - restyled.diff | git am
Or use the [hub-restyled](https://github.com/TokTok/hs-github-tools/blob/master/tools/hub-restyled) tool:
$ hub-restyled
EOM
exit 1