Skip to content

Commit

Permalink
chore(frontend): delete branch protection on release (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lodin authored Sep 7, 2021
1 parent a6adc41 commit aa5a1d1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions frontend/scripts/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ protection_config=$(ghr -X GET)

remapped=$(node scripts/protection-remap.js "$protection_config")

ghr -X PUT -d "$(echo "$remapped" | sed '$s/"enforce_admins":true/"enforce_admins":false/')" > /dev/null
# Restores the protection of the branch
restore_protection() {
ghr -X PUT -d "$remapped" > /dev/null
echo "Branch protection restored"
}

# Will execute "restore" function if "git push" causes an error
trap "restore" ERR

ghr -X DELETE > /dev/null

git push https://vaadin-bot:"$GIT_RELEASE_TOKEN"@github.com/"$REPO".git HEAD:$branch

ghr -X PUT -d "$remapped" > /dev/null
restore_protection

0 comments on commit aa5a1d1

Please sign in to comment.