chore: re-enable cherry-pick by label even after the PR is closed #2028
Workflow file for this run
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: PR Documentation Checker | |
on: | |
pull_request: | |
types: | |
- closed | |
- labeled | |
jobs: | |
check_pr_description: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if PR is merged | |
id: check_merged | |
run: echo "merged=$(echo ${{ github.event.pull_request.merged }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
- name: Retrieve PR information | |
uses: 8BitJonny/[email protected] | |
id: PR | |
with: | |
sha: ${{ github.event.pull_request.head.sha }} | |
- name: Check if documentation update is needed | |
id: check_documentation_update | |
if: steps.PR.outputs.pr_found == 'true' | |
run: | | |
if [[ $PR_BODY == *"- [x] My PR needs documentation updates."* ]]; then | |
echo "documentation_update=true" >> $GITHUB_OUTPUT | |
elif [[ $PR_LABEL == *"user-facing-changes"* ]]; then | |
echo "documentation_update=true" >> $GITHUB_OUTPUT | |
else | |
echo "documentation_update=false" >> $GITHUB_OUTPUT | |
fi | |
env: | |
PR_BODY: ${{ steps.PR.outputs.pr_body }} | |
PR_LABEL: ${{ steps.PR.outputs.pr_labels }} | |
- name: Create issue in other repository | |
if: steps.check_merged.outputs.merged == 'true' && steps.check_documentation_update.outputs.documentation_update == 'true' | |
run: | | |
ISSUE_CONTENT="This issue tracks the documentation update needed for the merged PR #$PR_ID.\n\nSource PR URL: $PR_URL\nSource PR Merged At: $PR_MERGED_AT" | |
curl -X POST \ | |
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \ | |
-d "{\"title\": \"Document: $PR_TITLE\",\"body\": \"$ISSUE_CONTENT\"}" \ | |
"https://api.github.com/repos/risingwavelabs/risingwave-docs/issues" | |
env: | |
PR_ID: ${{ steps.PR.outputs.number }} | |
PR_URL: ${{ steps.PR.outputs.pr_url }} | |
PR_TITLE: ${{ steps.PR.outputs.pr_title }} | |
PR_BODY: ${{ steps.PR.outputs.pr_body }} | |
PR_CREATED_AT: ${{ steps.PR.outputs.pr_created_at }} | |
PR_MERGED_AT: ${{ steps.PR.outputs.pr_merged_at }} | |
PR_CLOSED_AT: ${{ steps.PR.outputs.pr_closed_at }} | |
PR_LABEL: ${{ steps.PR.outputs.pr_labels }} | |
- name: print_output_variables | |
run: | | |
echo "Merged: ${{ steps.check_merged.outputs.merged }}" | |
echo "PR ID: ${{ steps.PR.outputs.number }}" | |
echo "PR URL: ${{ steps.PR.outputs.pr_url }}" | |
echo "PR Title: ${{ steps.PR.outputs.pr_title }}" | |
echo "PR Created At: ${{ steps.PR.outputs.pr_created_at }}" | |
echo "PR Merged At: ${{ steps.PR.outputs.pr_merged_at }}" | |
echo "PR Closed At: ${{ steps.PR.outputs.pr_closed_at }}" | |
echo "PR Labels: ${{ steps.PR.outputs.pr_labels }}" | |
echo "Documentation Update: ${{ steps.check_documentation_update.outputs.documentation_update }}" |