-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add update-antora-ui-spring.yml workflow
- Loading branch information
1 parent
c9c9cb5
commit ceda8e8
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Update Antora UI Spring | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
docs-branch: | ||
description: Branch used by Antora, defaults to docs-build | ||
required: false | ||
default: 'docs-build' | ||
type: string | ||
secrets: | ||
token: | ||
description: GitHub Token to Use to Open the PR | ||
required: false | ||
|
||
jobs: | ||
update-antora-ui-spring: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.docs-branch }} | ||
- name: Get Current UI Bundle URL | ||
uses: mikefarah/[email protected] | ||
id: current | ||
with: | ||
cmd: yq '.ui.bundle.url' antora-playbook.yml | ||
- name: Get Latest UI Bundle URL | ||
id: latest | ||
run: | | ||
echo latest_ui_bundle_url=$(gh api /repos/spring-io/antora-ui-spring/releases/latest | jq -r '.assets[] | select(.name == "ui-bundle.zip") | .browser_download_url') >> $GITHUB_OUTPUT | ||
echo tag_name=$(gh api /repos/spring-io/antora-ui-spring/releases/latest | jq -r '.tag_name') >> $GITHUB_OUTPUT | ||
shell: bash | ||
- name: Replace Version | ||
uses: mikefarah/[email protected] | ||
id: replace | ||
if: ${{ steps.current.outputs.result != steps.latest.outputs.latest_ui_bundle_url }} | ||
with: | ||
cmd: yq -i '.ui.bundle.url = "${{ steps.latest.outputs.latest_ui_bundle_url }}"' antora-playbook.yml | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ inputs.token }} | ||
title: Update Antora UI Spring to ${{ steps.latest.outputs.tag_name }} | ||
commit-message: Update Antora UI Spring to ${{ steps.latest.outputs.tag_name }} | ||
delete-branch: true | ||
base: ${{ inputs.docs-branch }} |