Skip to content

Commit e7c35fa

Browse files
committed
ci.yml: Redeploy is now branch deployments + redeploy deployments
Removed ci-comment pr inputs
1 parent 6c59a34 commit e7c35fa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/ci.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ jobs:
9797
# Essentially, count all the deployment entries that match the given branch.
9898
# See https://docs.github.com/en/rest/deployments/deployments?apiVersion=2022-11-28#list-deployments
9999
run: |
100-
next_deployment_number=$(gh api \
100+
pr_deployments=$(gh api \
101101
-H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
102102
--paginate \
103103
/repos/${{ github.repository }}/deployments \
104-
--jq '[.[] | select(.ref == "${{ steps.pr.outputs.head }}")] | length + 1'
104+
--jq '[.[] | select(.ref == "${{ steps.pr.outputs.head }}")] | length'
105105
)
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))
106111
echo "Next Deployment Number is $next_deployment_number"
107112
echo "next-deployment-number=$next_deployment_number" >> $GITHUB_OUTPUT
108113

0 commit comments

Comments
 (0)