-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
49 lines (43 loc) · 1.15 KB
/
action.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
name: "Run buildifier"
description: "Runs Bazel's lint tool buildifier"
branding:
icon: "umbrella"
color: "green"
inputs:
buildifier-version:
description: "Buildifier version"
required: false
default: "6.0.0"
path:
description: "Path in which to run buildifier,"
required: false
default: "."
mode:
description: "Mode in which to run buildifier "
required: false
default: "check"
token:
description: Used to query buildifier releases.
default: ${{ github.token }}
outputs:
success:
description: "Status of the buildifier check"
runs:
using: "composite"
steps:
- name: Setup buildifier
uses: jbajic/setup-buildifier-action@v1
- run: buildifier -r -mode check ${{ inputs.path }}
id: buildifier-action-check
shell: bash
if: ${{ inputs.mode == 'check' }}
- run: |
buildifier -r -multi_diff ${{ inputs.path }}
BUILDIFIER_FILES_DIFF=$(git --no-pager diff)
git checkout .
if [[ "$BUILDIFIER_FILES_DIFF" != '' ]]; then
echo -e "$BUILDIFIER_FILES_DIFF"
exit 1
fi
shell: bash
if: ${{ inputs.mode != 'check' }}