Fix webhook certificates always being issued for the marblerun
name…
#26
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: Publish CLI reference to documentation | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- "cli/**" | |
- "hack/clidocgen/**" | |
jobs: | |
publish-to-docs: | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/edgelesssys/edgelessrt-dev:ci | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }} | |
- name: Setup | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Generate reference docs | |
run: go run . | cat header.md - > ../../cli.md | |
working-directory: hack/clidocgen | |
- name: Get commit sha | |
run: | | |
echo "COMMIT_END=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV" | |
- name: Check if action branch exists | |
shell: bash -e {0} | |
run: | | |
ex="$(git ls-remote --heads origin action/marblerun/update-cli-reference)" | |
echo "EXISTS=$(if [[ -z "$ex" ]]; then echo 0; else echo 1; fi)" >> "$GITHUB_ENV" | |
- name: Publish new reference (create new branch) | |
if: ${{ env.EXISTS == 0 }} | |
uses: dmnemec/copy_file_to_another_repo_action@c93037aa10fa8893de271f19978c980d0c1a9b37 # v1.1.1 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.CI_GITHUB_REPOSITORY }} | |
with: | |
source_file: "cli.md" | |
destination_repo: "edgelesssys/marblerun" | |
destination_branch: "master" | |
destination_branch_create: "action/marblerun/update-cli-reference" | |
destination_folder: "docs/docs/reference" | |
user_name: "${{ github.actor }}" | |
user_email: "${{ github.actor }}@users.noreply.github.com" | |
commit_message: "CLI reference was updated by edgelesssys/marblerun@${{ env.COMMIT_END}}" | |
- name: Publish new reference (update branch) | |
if: ${{ env.EXISTS == 1 }} | |
uses: dmnemec/copy_file_to_another_repo_action@c93037aa10fa8893de271f19978c980d0c1a9b37 # v1.1.1 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.CI_GITHUB_REPOSITORY }} | |
with: | |
source_file: "cli.md" | |
destination_repo: "edgelesssys/marblerun" | |
destination_branch: "action/marblerun/update-cli-reference" | |
destination_folder: "docs/docs/reference" | |
user_name: "${{ github.actor }}" | |
user_email: "${{ github.actor }}@users.noreply.github.com" | |
commit_message: "CLI reference was updated by edgelesssys/marblerun@${{ env.COMMIT_END}}" |