-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathaction.yml
40 lines (36 loc) · 1.05 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
name: Run `prettier` on a branch
description: This action runs `prettier` on a branch.
inputs:
branch:
description: Name of branch to checkout and write changes to.
required: true
token:
default: ${{ github.token }}
description: Used to open the PR.
required: false
runs:
using: composite
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
ref: ${{ inputs.branch }}
- name: Update `make docs` procedure
run: |
set -euf -o pipefail
if [[ -n "${RUNNER_DEBUG+x}" ]]; then
set -x
fi
# commit adds and commits the updated files as the Grafanabot GitHub user.
function commit {
git add .
git config --local user.email [email protected]
git config --local user.name grafanabot
git commit --message 'Run `prettier`'
}
npx prettier -w .
if ! git diff --exit-code; then
commit
git push origin
fi
shell: bash