chore: Link OpenAPI docs sync to correct PR (#19067)

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
Marc Littlemore
2025-09-02 09:54:59 +01:00
committed by GitHub
parent a1504cf42b
commit d183652c0d

View File

@@ -82,6 +82,28 @@ jobs:
echo "Copying 'packages/cli/dist/public-api/v1/openapi.yml' to '${DOCS_TARGET_PATH}'"
cp packages/cli/dist/public-api/v1/openapi.yml "${DOCS_TARGET_PATH}"
- name: Extract PR number from commit message
if: steps.verify_file.outputs.file_exists == 'true'
id: extract_pr
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%s)
echo "Commit message: $COMMIT_MESSAGE"
# Extract PR number from commit message (format: "title (#1234)")
PR_NUMBER=$(echo "$COMMIT_MESSAGE" | grep -om1E '\(#[0-9]+\)' | grep -oE '[0-9]+' || echo "")
if [ -n "$PR_NUMBER" ]; then
echo "Found PR number: $PR_NUMBER"
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "pr_url=https://github.com/${{ github.repository }}/pull/$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "source_link=Source PR: [$PR_NUMBER](https://github.com/${{ github.repository }}/pull/$PR_NUMBER)" >> "$GITHUB_OUTPUT"
else
echo "No PR number found in commit message, using commit link"
echo "pr_number=" >> "$GITHUB_OUTPUT"
echo "pr_url=" >> "$GITHUB_OUTPUT"
echo "source_link=Source commit: [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> "$GITHUB_OUTPUT"
fi
- name: Create PR in Docs Repo
if: steps.verify_file.outputs.file_exists == 'true'
@@ -105,6 +127,6 @@ jobs:
Automated update of the Public API OpenAPI YAML schema.
This PR was generated by a GitHub Action in the [${{ github.repository }} repository](https://github.com/${{ github.repository }}).
Source commit: [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
${{ steps.extract_pr.outputs.source_link }}
Please review the changes and merge if appropriate.