Skip to content

Commit d037270

Browse files
fix: enhance workflows for OCM CLI documentation updates and HTML verification (#463)
On-behalf-of: Gerald Morrison (SAP) <[email protected]> Signed-off-by: Gerald Morrison (SAP) <[email protected]> <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it fixes: open-component-model/ocm-project#492 --------- Signed-off-by: Gerald Morrison (SAP) <[email protected]> Co-authored-by: Gerald Morrison (SAP) <[email protected]>
1 parent 7c36b88 commit d037270

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.github/workflows/update-cli-docs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Update OCM CLI Docs
22

3+
permissions:
4+
contents: read # for checkout, file reads
5+
actions: write # to call repository_dispatch
6+
pull-requests: write # to create or update PRs
7+
38
on:
49
repository_dispatch:
510
types: [ocm-cli-release]
@@ -20,22 +25,36 @@ jobs:
2025
- uses: actions/checkout@v4
2126
with:
2227
persist-credentials: false
28+
2329
- name: Update Version Parameter
2430
run: |
2531
TAG=${{ github.event.client_payload.tag }}
2632
sed -i "s/latest_version = .*/latest_version = \"$TAG\"/" ./config/_default/params.toml
33+
2734
- name: Setup Go
2835
uses: actions/setup-go@v5
2936
with:
3037
go-version-file: '${{ github.workspace }}/go.mod'
38+
3139
- name: Regenerate CLI docs
3240
run: |
3341
go get ocm.software/ocm@${{ github.event.client_payload.tag }}
3442
go mod tidy
3543
go run ./hack/generate-cli-docs --output-dir=${{ env.OUTPUT_DIR }}
44+
45+
- name: Get OCMBot installation token
46+
# Instead of creating the PR below with GITHUB_TOKEN use a generated
47+
# short-lived App installation token with full REST rights
48+
id: generate_token
49+
uses: tibdex/github-app-token@v2
50+
with:
51+
app_id: ${{ secrets.OCMBOT_APP_ID }}
52+
private_key: ${{ secrets.OCMBOT_PRIV_KEY }}
53+
3654
- name: Create Pull Request
3755
uses: peter-evans/create-pull-request@v7
3856
with:
57+
token: ${{ steps.generate_token.outputs.token }}
3958
title: "Update CLI docs"
4059
commit-message: "[github-actions] automated change"
4160
add-paths: |
@@ -49,3 +68,4 @@ jobs:
4968
sign-commits: true
5069
body: |
5170
Update OCM CLI documentation for new release
71+

.github/workflows/verify-html.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
- name: Verify HTML links
2323
uses: untitaker/[email protected]
2424
with:
25-
args: public/ --sources content/
25+
args: public/ --sources content/

0 commit comments

Comments
 (0)