constellation/.github/workflows/update-cli-reference.yml

56 lines
2.1 KiB
YAML
Raw Normal View History

name: Update the CLI reference page of the documentation
on:
2022-10-12 08:50:06 +00:00
workflow_dispatch:
push:
branches:
- main
2022-09-03 15:47:47 +00:00
paths:
- "cli/cmd/**"
- "cli/internal/cmd/**"
2022-09-16 13:46:23 +00:00
- "hack/clidocgen/**"
- ".github/workflows/update-cli-reference.yml"
jobs:
update-docs:
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Constellation
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
2022-09-14 13:14:26 +00:00
- name: Setup Go environment
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: "1.20.2"
2022-09-14 13:14:26 +00:00
cache: true
- name: Regenerate CLI reference of the documentation
working-directory: hack/clidocgen
run: go run . | cat header.md - > ../../docs/docs/reference/cli.md
- name: Create PR (if there are changes)
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
branch: ci/cli-ref/update
base: main
title: "docs: update cli reference"
body: |
:robot: *This is an automated PR.* :robot:
Changes in the CLI triggered this PR, it updates the corresponding documentation page.
If there is anything wrong with the content of this PR, **please don't do changes on this PR**,
rather make the changes in the CLI code and open a separate PR.
You can leave this PR open (it will be updated, use a "hold" label) or close it (a new PR will
be created automatically on new changes on main).
commit-message: "docs: update cli reference"
committer: edgelessci <edgelessci@users.noreply.github.com>
labels: no changelog
# We need to push changes using a token, otherwise triggers like on:push and on:pull_request won't work.
token: ${{ !github.event.pull_request.head.repo.fork && secrets.CI_COMMIT_PUSH_PR || '' }}