-
Notifications
You must be signed in to change notification settings - Fork 617
34 lines (32 loc) · 1.02 KB
/
pr_fixup.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
on:
push:
branches:
- main
name: PR Fixup
jobs:
format-sites:
name: Run formatter and commit changes
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Format entries
uses: mikefarah/[email protected]
with:
cmd: yq --inplace 'sort_by(.domain)' _data/sites.yml
- name: Add back newline between entries
run: |
sed -i 's/- domain:/\n- domain:/g' _data/sites.yml
- name: Format and commit code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --write _data/sites.yml
commit_message: Fix formatting