Skip to content

Commit

Permalink
Update release.yml (#333)
Browse files Browse the repository at this point in the history
Fix release workflow with approval logic
  • Loading branch information
ljtill authored May 10, 2021
1 parent 65ed937 commit d852b7e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,24 @@ jobs:
- name: "Merge"
run: |
gh pr create --base 'main' --head 'release' --title 'Release v${{ steps.version.outputs.version }}' --body '' --label 'release :zap:'
gh pr merge 'release' --squash --delete-branch
gh pr create --base 'main' --head 'release' --title 'Release v${{ steps.version.outputs.version }}' --body '' --label 'release :zap:' --reviewer Azure/enterprisescale-vteam
COUNTER=0
while : ; do
DECISION=$(gh pr status --json reviewDecision --jq '.currentBranch.reviewDecision')
if [ "$DECISION" == "APPROVED" ]; then
gh pr merge 'release' --squash --delete-branch
break
else
if [ $COUNTER -lt 300 ]; then
echo "Pending pull request approval - $COUNTER seconds"
sleep 30s
COUNTER=$(( $COUNTER + 30 ))
else
echo "Expired pull request approval"
exit 1
fi
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit d852b7e

Please sign in to comment.