2023-01-24 12:52:41 -05:00
|
|
|
name: Update the CLI reference page of the documentation
|
|
|
|
|
2022-07-15 04:23:52 -04:00
|
|
|
on:
|
2022-10-12 04:50:06 -04:00
|
|
|
workflow_dispatch:
|
2022-07-15 04:23:52 -04:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2022-09-03 11:47:47 -04:00
|
|
|
paths:
|
2022-09-09 04:26:25 -04:00
|
|
|
- "cli/cmd/**"
|
|
|
|
- "cli/internal/cmd/**"
|
2022-09-16 09:46:23 -04:00
|
|
|
- "hack/clidocgen/**"
|
2023-02-03 12:00:16 -05:00
|
|
|
- ".github/workflows/update-cli-reference.yml"
|
2022-07-15 04:23:52 -04:00
|
|
|
|
|
|
|
jobs:
|
2023-01-24 12:52:41 -05:00
|
|
|
update-docs:
|
2022-11-10 10:55:24 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2023-02-01 10:54:12 -05:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
2022-07-15 04:23:52 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout Constellation
|
2023-03-22 12:57:47 -04:00
|
|
|
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
2022-11-10 11:22:26 -05:00
|
|
|
with:
|
2022-12-19 09:21:28 -05:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-07-15 04:23:52 -04:00
|
|
|
|
2022-09-14 09:14:26 -04:00
|
|
|
- name: Setup Go environment
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
2022-07-15 04:23:52 -04:00
|
|
|
with:
|
2023-03-08 04:05:36 -05:00
|
|
|
go-version: "1.20.2"
|
2022-09-14 09:14:26 -04:00
|
|
|
cache: true
|
2022-07-15 04:23:52 -04:00
|
|
|
|
2023-01-24 12:52:41 -05:00
|
|
|
- name: Regenerate CLI reference of the documentation
|
2022-09-09 05:19:28 -04:00
|
|
|
working-directory: hack/clidocgen
|
2023-02-03 12:00:16 -05:00
|
|
|
run: go run . | cat header.md - > ../../docs/docs/reference/cli.md
|
2022-07-15 04:23:52 -04:00
|
|
|
|
2023-01-24 12:52:41 -05:00
|
|
|
- name: Create PR (if there are changes)
|
2023-03-22 12:57:47 -04:00
|
|
|
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # v4.2.4
|
2022-07-15 04:23:52 -04:00
|
|
|
with:
|
2023-01-24 12:52:41 -05:00
|
|
|
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>
|
2023-01-26 09:29:20 -05:00
|
|
|
labels: no changelog
|
2023-02-27 09:16:07 -05:00
|
|
|
# We need to push changes using a token, otherwise triggers like on:push and on:pull_request won't work.
|
2023-03-02 12:07:29 -05:00
|
|
|
token: ${{ !github.event.pull_request.head.repo.fork && secrets.CI_COMMIT_PUSH_PR || '' }}
|