Skip to content

Commit 2a4f4bb

Browse files
authored
Merge pull request #23 from marcusdacoregio/patch-1
Create update-antora-ui-spring.yml
2 parents 075e9f6 + 403c0e6 commit 2a4f4bb

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Diff for: .github/workflows/update-antora-ui-spring.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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: Token to use the GH CLI and to Open PRs
14+
required: true
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+
fetch-depth: 1
24+
- name: Get Current UI Bundle URL
25+
uses: mikefarah/[email protected]
26+
id: current
27+
with:
28+
cmd: yq '.ui.bundle.url' antora-playbook.yml
29+
- name: Get Latest UI Bundle URL
30+
id: latest
31+
run: |
32+
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
33+
echo tag_name=$(gh api /repos/spring-io/antora-ui-spring/releases/latest | jq -r '.tag_name') >> $GITHUB_OUTPUT
34+
shell: bash
35+
env:
36+
GH_TOKEN: ${{ secrets.token }}
37+
- name: Replace Current with Latest
38+
id: replace
39+
if: ${{ steps.current.outputs.result != steps.latest.outputs.latest_ui_bundle_url }}
40+
run: |
41+
sed -i 's@${{ steps.current.outputs.result }}@${{ steps.latest.outputs.latest_ui_bundle_url }}@g' antora-playbook.yml
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@v6
44+
with:
45+
token: ${{ secrets.token }}
46+
title: Update Antora UI Spring to ${{ steps.latest.outputs.tag_name }}
47+
body: Automated changes
48+
commit-message: Update Antora UI Spring to ${{ steps.latest.outputs.tag_name }}
49+
delete-branch: true
50+
base: ${{ inputs.docs-branch }}

0 commit comments

Comments
 (0)