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

Conversation

holly-cummins
Copy link
Contributor

Resolves #161.

As always with workflow changes, this is hard to test. I de-sorted a local copy of the yaml and have run my script locally on the current yaml file. The output is included in this PR. You can see it tidied up a few trailing whitespaces, which is no bad thing, IMO. The comment removal was mine, since I didn't think we needed it anymore.

After sorting, the script raises a PR with changes. We could use something like https://github.com/marketplace/actions/git-auto-commit instead, but I thought we should start cautious. :)

After merging, I expect this will run successfully, but not create any PRs. To get the first PR, we'll need to wait for the next extension which adds documentation (and gets the order wrong).

@holly-cummins holly-cummins requested a review from gastaldi August 8, 2024 18:41
.github/workflows/alphabetise.yml Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Aug 8, 2024

🙈 The PR is closed and the preview is expired.

@holly-cummins holly-cummins requested a review from gsmet August 8, 2024 19:09
Comment on lines 33 to 38
- name: Alphabetise
id: alpha
uses: mikefarah/yq@master
with:
path: antora-playbook.yml
cmd: '.content.sources |= sort_by(.url)'
Copy link
Member

Choose a reason for hiding this comment

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

I think GitHub already comes with yq installed, so I don't think we need this action

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, that would be handy. There's a zillion actions for installing it, which is a bit pointless if it already has it. But let's try it without it first.

Copy link
Member

Choose a reason for hiding this comment

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

If not found, maybe use this action to install it, since we're already using it in our Quarkiverse extensions: https://github.com/quarkiverse/quarkus-ironjacamar/blob/main/.github/workflows/quarkus-snapshot.yaml#L37-L38

Copy link
Member

Choose a reason for hiding this comment

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

jq for sure. yq I'm not sure at all.

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

Copy link
Member

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

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

LGTM

@gastaldi gastaldi merged commit 812e917 into quarkiverse:main Aug 8, 2024
2 checks passed
@gastaldi gastaldi mentioned this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically alphabetise source file in an async job
3 participants