Skip to content

Commit

Permalink
ci.yml: Redeploy is now branch deployments + redeploy deployments
Browse files Browse the repository at this point in the history
Removed ci-comment pr inputs
  • Loading branch information
CodeGat committed Dec 4, 2024
1 parent 6c59a34 commit e7c35fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,17 @@ jobs:
# Essentially, count all the deployment entries that match the given branch.
# See https://docs.github.com/en/rest/deployments/deployments?apiVersion=2022-11-28#list-deployments
run: |
next_deployment_number=$(gh api \
pr_deployments=$(gh api \
-H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
--paginate \
/repos/${{ github.repository }}/deployments \
--jq '[.[] | select(.ref == "${{ steps.pr.outputs.head }}")] | length + 1'
--jq '[.[] | select(.ref == "${{ steps.pr.outputs.head }}")] | length'
)
comment_deployments=$(gh pr view ${{ inputs.pr }} --repo ${{ github.repository }} \
--json comments \
--jq '[.comments[] | select(.body | startswith("!redeploy"))] | length'
)
next_deployment_number=$((pr_deployments + comment_deployments + 1))
echo "Next Deployment Number is $next_deployment_number"
echo "next-deployment-number=$next_deployment_number" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit e7c35fa

Please sign in to comment.