mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
.github: Suppress cherry-pick reminder for some situations
In PROpenedOrUpdated, the cherry-pick reminder will now be suppressed if there are already valid 'cherry-pick-to' comments in the PR or the PR contained a 'cherry-pick-to: none' comment.
This commit is contained in:
32
.github/workflows/PROpenedOrUpdated.yml
vendored
32
.github/workflows/PROpenedOrUpdated.yml
vendored
@@ -27,19 +27,23 @@ jobs:
|
|||||||
application_private_key: ${{secrets.ASTERISK_ORG_ACCESS_APP_PRIV_KEY}}
|
application_private_key: ${{secrets.ASTERISK_ORG_ACCESS_APP_PRIV_KEY}}
|
||||||
organization: asterisk
|
organization: asterisk
|
||||||
|
|
||||||
- name: Add cherry-pick reminder and reviewers
|
- name: Get cherry-pick branches
|
||||||
if: github.event.action == 'opened'
|
uses: asterisk/asterisk-ci-actions/GetCherryPickBranchesFromPR@main
|
||||||
|
id: getbranches
|
||||||
|
with:
|
||||||
|
repo: ${{github.repository}}
|
||||||
|
pr_number: ${{env.PR_NUMBER}}
|
||||||
|
cherry_pick_regex: ${{vars.CHERRY_PICK_REGEX}}
|
||||||
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|
||||||
|
- name: Add cherry-pick reminder
|
||||||
|
if: ${{ steps.getbranches.outputs.branch_count == 0 || steps.getbranches.outputs.forced_none != 'true' }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
GITHUB_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
||||||
GH_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
GH_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
||||||
CHERRY_PICK_REMINDER: ${{vars.CHERRY_PICK_REMINDER}}
|
CHERRY_PICK_REMINDER: ${{vars.CHERRY_PICK_REMINDER}}
|
||||||
REVIEWERS: ${{vars.PR_REVIEWERS}}
|
|
||||||
run: |
|
run: |
|
||||||
IFS=$'; \n'
|
IFS=$'; \n'
|
||||||
for r in $REVIEWERS ; do
|
|
||||||
echo "Adding reviewer $r"
|
|
||||||
gh pr edit --repo ${{github.repository}} ${PR_NUMBER} --add-reviewer $r || :
|
|
||||||
done
|
|
||||||
# If there's already a reminder comment, don't add another one.
|
# If there's already a reminder comment, don't add another one.
|
||||||
ADD_COMMENT=true
|
ADD_COMMENT=true
|
||||||
# This query will FAIL if it finds the comment.
|
# This query will FAIL if it finds the comment.
|
||||||
@@ -54,6 +58,20 @@ jobs:
|
|||||||
echo "CPR comment already present"
|
echo "CPR comment already present"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Add reviewers
|
||||||
|
if: github.event.action == 'opened'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
||||||
|
GH_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
||||||
|
CHERRY_PICK_REMINDER: ${{vars.CHERRY_PICK_REMINDER}}
|
||||||
|
REVIEWERS: ${{vars.PR_REVIEWERS}}
|
||||||
|
run: |
|
||||||
|
IFS=$'; \n'
|
||||||
|
for r in $REVIEWERS ; do
|
||||||
|
echo "Adding reviewer $r"
|
||||||
|
gh pr edit --repo ${{github.repository}} ${PR_NUMBER} --add-reviewer $r || :
|
||||||
|
done
|
||||||
|
|
||||||
- name: Set Labels
|
- name: Set Labels
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
Reference in New Issue
Block a user