Skip to content

Commit

Permalink
BC-9077 filter out already closed prs (#1116)
Browse files Browse the repository at this point in the history
when determining the namespace activator function to call
  • Loading branch information
Loki-Afro authored Feb 24, 2025
1 parent 5fe99af commit 20f7fef
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,24 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
# gh pr view will exit with 1 when there is no pr for a given branch
pr_labels=$(gh pr view ${{ inputs.branch }} --repo ${{ github.repository }} --json labels 2>/dev/null) && echo "$pr_labels" || echo "no pr found"
echo "pr_labels: $pr_labels"
has_activation_label=$(echo $pr_labels | jq '.labels[] | select(.name == "auto-extend-activation-time") | length > 0')
pr_data=$(gh pr view "${{ inputs.branch }}" --repo "${{ github.repository }}" --json labels,state 2>/dev/null || echo "error")
has_activation_label="false"
if [[ "$pr_data" != "error" ]]; then
pr_state=$(echo "$pr_data" | jq -r '.state')
if [[ "$pr_state" == "OPEN" ]]; then
pr_labels=$(echo "$pr_data" | jq -c '.labels')
echo "pr_labels: $pr_labels"
has_activation_label=$(echo "$pr_labels" | jq '[.[] | select(.name == "auto-extend-activation-time")] | length > 0')
else
echo "PR is not open"
fi
else
echo "no pr found"
fi
if [ "$has_activation_label" == "true" ]; then
echo "has pr, has label, extend activation time"
Expand Down

0 comments on commit 20f7fef

Please sign in to comment.