Skip to content

Commit ceda8e8

Browse files
Add update-antora-ui-spring.yml workflow
1 parent c9c9cb5 commit ceda8e8

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Update Antora UI Spring
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
docs-branch:
7+
description: Branch used by Antora, defaults to docs-build
8+
required: false
9+
default: 'docs-build'
10+
type: string
11+
secrets:
12+
token:
13+
description: GitHub Token to Use to Open the PR
14+
required: false
15+
16+
jobs:
17+
update-antora-ui-spring:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ inputs.docs-branch }}
23+
- name: Get Current UI Bundle URL
24+
uses: mikefarah/[email protected]
25+
id: current
26+
with:
27+
cmd: yq '.ui.bundle.url' antora-playbook.yml
28+
- name: Get Latest UI Bundle URL
29+
id: latest
30+
run: |
31+
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
32+
echo tag_name=$(gh api /repos/spring-io/antora-ui-spring/releases/latest | jq -r '.tag_name') >> $GITHUB_OUTPUT
33+
shell: bash
34+
- name: Replace Version
35+
uses: mikefarah/[email protected]
36+
id: replace
37+
if: ${{ steps.current.outputs.result != steps.latest.outputs.latest_ui_bundle_url }}
38+
with:
39+
cmd: yq -i '.ui.bundle.url = "${{ steps.latest.outputs.latest_ui_bundle_url }}"' antora-playbook.yml
40+
- name: Create Pull Request
41+
uses: peter-evans/create-pull-request@v6
42+
with:
43+
token: ${{ inputs.token }}
44+
title: Update Antora UI Spring to ${{ steps.latest.outputs.tag_name }}
45+
commit-message: Update Antora UI Spring to ${{ steps.latest.outputs.tag_name }}
46+
delete-branch: true
47+
base: ${{ inputs.docs-branch }}

0 commit comments

Comments
 (0)