Skip to content

JSON tidy

JSON tidy #1213

Workflow file for this run

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