forked from quarkiverse/quarkiverse-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.15 KB
/
alphabetise.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
41
42
43
44
45
46
47
48
49
50
51
52
name: Alphabetise extension list
on:
push:
branches: [ main ]
paths:
- antora-playbook.yml
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install packages
run: npm install -g yaml-sort
- name: Alphabetise
id: alpha
uses: mikefarah/yq@master
with:
path: antora-playbook.yml
cmd: '.content.sources |= sort_by(.url)'
- name: Overwite file
run: |
echo ${{ steps.alpha.outputs.result }} > antora-playbook.yml
- name: Create Pull Request
run: |
git checkout -b alpha-${{ github.run_id }}
git add antora-playbook.yml
git commit -m "Automatic alphabetisation"
git push
gh pr create --title "Automatic alphabetisation" --fill --repo $GITHUB_REPOSITORY
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}