-
Notifications
You must be signed in to change notification settings - Fork 18
36 lines (33 loc) · 1.13 KB
/
json-tidy.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
name: JSON tidy
on:
pull_request:
merge_group:
jobs:
json-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Check out the git repo using the 'head' ref, so that
# we can commit to the branch if needed - but only if
# this is not a fork
with:
ref: ${{ github.event.pull_request.head.ref }}
if: github.event.pull_request.head.repo.full_name == github.repository
- uses: actions/checkout@v4
# Checkout the default way if it is a fork
if: github.event.pull_request.head.repo.full_name != github.repository
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Run JSON tidy
run: .github/lib/json-tidy.rb
- name: Commit any JSON changes
# Skip this step if it’s a fork, as we won’t have permission to commit
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
git config --global user.email "[email protected]"
git config --global user.name "json-tidy-bot"
git add --all
git commit -m "JSON tidy" || exit 0
git push