Skip to content

update skytils link #21

update skytils link

update skytils link #21

Workflow file for this run

name: Format (or check) JSON
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: "*"
pull_request:
branches: "*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
format_json:
name: Format JSON
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Configure git
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Grab Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Install dependencies
run: |
npm install -g prettier
- name: Check Prettier
run: |
npx prettier **/*.json --check
if: ${{ github.event_name != 'push' }}
- name: Run Prettier
run: |
npx prettier **/*.json --write
if: ${{ github.event_name == 'push' }}
- name: Commit
run: |
#!/bin/bash
set +e
git commit -am "Automatically prettify json"
set -e
if: ${{ github.event_name == 'push' }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
if: ${{ github.event_name == 'push' }}