Update OCM CLI Docs #62
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
name: Update OCM CLI Docs | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [ocm-cli-release] | |
env: | |
OUTPUT_DIR: ./content/docs/cli-reference | |
jobs: | |
generate-cli-reference: | |
name: Update content/docs/cli-reference | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'write' | |
id-token: 'write' | |
pull-requests: 'write' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Update Version Parameter | |
if: github.event.client_payload != '' | |
run: | | |
TAG=${{ github.event.client_payload.tag }} | |
sed -i "s/latest_version = .*/latest_version = \"$TAG\"/" ./config/_default/params.toml | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: Regenerate CLI docs | |
run: | | |
go mod tidy | |
go run ./hack/generate-cli-docs --output-dir=${{ env.OUTPUT_DIR }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
title: "Update CLI docs" | |
commit-message: "[github-actions] automated change" | |
add-paths: | | |
config/ | |
content/ | |
branch: update-cli-docs/auto | |
branch-suffix: timestamp | |
delete-branch: true | |
body: | | |
Update OCM CLI documentation for new release |