File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -97,12 +97,17 @@ jobs:
97
97
# Essentially, count all the deployment entries that match the given branch.
98
98
# See https://docs.github.com/en/rest/deployments/deployments?apiVersion=2022-11-28#list-deployments
99
99
run : |
100
- next_deployment_number =$(gh api \
100
+ pr_deployments =$(gh api \
101
101
-H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
102
102
--paginate \
103
103
/repos/${{ github.repository }}/deployments \
104
- --jq '[.[] | select(.ref == "${{ steps.pr.outputs.head }}")] | length + 1 '
104
+ --jq '[.[] | select(.ref == "${{ steps.pr.outputs.head }}")] | length'
105
105
)
106
+ comment_deployments=$(gh pr view ${{ inputs.pr }} --repo ${{ github.repository }} \
107
+ --json comments \
108
+ --jq '[.comments[] | select(.body | startswith("!redeploy"))] | length'
109
+ )
110
+ next_deployment_number=$((pr_deployments + comment_deployments + 1))
106
111
echo "Next Deployment Number is $next_deployment_number"
107
112
echo "next-deployment-number=$next_deployment_number" >> $GITHUB_OUTPUT
108
113
You can’t perform that action at this time.
0 commit comments