Skip to content

Update OCM CLI Docs #48

Update OCM CLI Docs

Update OCM CLI Docs #48

name: Update OCM CLI Docs
on:
workflow_dispatch:
repository_dispatch:
types: [ocm-cli-release]
env:
OUTPUT_DIR: ./content/en/docs/cli-reference
jobs:
setup-build-pull:
name: Setup, Build and Create PR
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@v4
with:
go-version-file: '${{ github.workspace }}/go.mod'
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Regenerate CLI docs
run: |
go mod tidy
go run ./hack/generate-cli-docs ${{ env.OUTPUT_DIR }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
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