Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically alphabetise antora yaml after changes #173

Merged
merged 7 commits into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/alphabetise.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: Alphabetise
id: alpha
run: |
yq '.content.sources |= sort_by(.url)' antora-playbook.yml > antora-playbook-sorted.yml
mv antora-playbook-sorted.yml antora-playbook.yml

- name: Create Pull Request
# Skip main in forks
if: "github.repository == 'quarkiverse/quarkiverse-docs' && endsWith(github.ref, '/main')"
run: |
git checkout -b alpha-${{ github.run_id }}
git add antora-playbook.yml
git commit -m "Automatic alphabetisation"
git push
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to push explicitly, as gh pr create below already does that

gh pr create --title "Automatic alphabetisation" --fill --repo $GITHUB_REPOSITORY
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}