Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/sync-public-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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.
Loading