82
82
echo "Copying 'packages/cli/dist/public-api/v1/openapi.yml' to '${DOCS_TARGET_PATH}'"
83
83
cp packages/cli/dist/public-api/v1/openapi.yml "${DOCS_TARGET_PATH}"
84
84
85
+ - name : Extract PR number from commit message
86
+ if : steps.verify_file.outputs.file_exists == 'true'
87
+ id : extract_pr
88
+ run : |
89
+ COMMIT_MESSAGE=$(git log -1 --pretty=%s)
90
+ echo "Commit message: $COMMIT_MESSAGE"
91
+
92
+ # Extract PR number from commit message (format: "title (#1234)")
93
+ PR_NUMBER=$(echo "$COMMIT_MESSAGE" | grep -om1E '\(#[0-9]+\)' | grep -oE '[0-9]+' || echo "")
94
+
95
+ if [ -n "$PR_NUMBER" ]; then
96
+ echo "Found PR number: $PR_NUMBER"
97
+ echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
98
+ echo "pr_url=https://github.com/${{ github.repository }}/pull/$PR_NUMBER" >> "$GITHUB_OUTPUT"
99
+ echo "source_link=Source PR: [$PR_NUMBER](https://github.com/${{ github.repository }}/pull/$PR_NUMBER)" >> "$GITHUB_OUTPUT"
100
+ else
101
+ echo "No PR number found in commit message, using commit link"
102
+ echo "pr_number=" >> "$GITHUB_OUTPUT"
103
+ echo "pr_url=" >> "$GITHUB_OUTPUT"
104
+ echo "source_link=Source commit: [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> "$GITHUB_OUTPUT"
105
+ fi
106
+
85
107
- name : Create PR in Docs Repo
86
108
if : steps.verify_file.outputs.file_exists == 'true'
87
109
@@ -105,6 +127,6 @@ jobs:
105
127
Automated update of the Public API OpenAPI YAML schema.
106
128
107
129
This PR was generated by a GitHub Action in the [${{ github.repository }} repository](https://github.com/${{ github.repository }}).
108
- Source commit: [ ${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
130
+ ${{ steps.extract_pr.outputs.source_link }}
109
131
110
132
Please review the changes and merge if appropriate.
0 commit comments