Skip to content

Commit

Permalink
CreatePrivateRepo: Update the action activation branch dance
Browse files Browse the repository at this point in the history
  • Loading branch information
gtjoseph committed May 17, 2024
1 parent 91763fe commit 1c4600b
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions scripts/entrypointCreatePrivateFork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,22 @@ cd ..

# We have to do a little dance here to get GitHub to recoginze
# that we have actions on the master branch.
sleep 5
gh repo edit asterisk/${INPUT_DST_REPO} --default-branch=21
sleep 10
gh repo edit asterisk/${INPUT_DST_REPO} --default-branch=master
# Let things settle a bit
sleep 10

# Make sure that resetting the default branch worked by seeing
# if we can view the CreateDocs workflow.
declare -i count=0
while [ $count -le 5 ] ; do
while [ $count -le 10 ] ; do
gh repo edit asterisk/${INPUT_DST_REPO} --default-branch=21
sleep 5
gh repo edit asterisk/${INPUT_DST_REPO} --default-branch=master
sleep 10
gh -R asterisk/${INPUT_DST_REPO} workflow view CreateDocs >/dev/null && break
sleep 5
count+=1
done

# Disable the workflows we never want to run in the private repo
gh -R asterisk/${INPUT_DST_REPO} workflow disable CreateDocs
gh -R asterisk/${INPUT_DST_REPO} workflow disable MergeApproved
gh -R asterisk/${INPUT_DST_REPO} workflow disable NightlyTests
gh -R asterisk/${INPUT_DST_REPO} workflow disable "Nightly Admin"
gh -R asterisk/${INPUT_DST_REPO} workflow disable Releaser
gh -R asterisk/${INPUT_DST_REPO} workflow disable CreateDocs || :
gh -R asterisk/${INPUT_DST_REPO} workflow disable MergeApproved || :
gh -R asterisk/${INPUT_DST_REPO} workflow disable NightlyTests || :
gh -R asterisk/${INPUT_DST_REPO} workflow disable NightlyAdmin || :
gh -R asterisk/${INPUT_DST_REPO} workflow disable Releaser || :

0 comments on commit 1c4600b

Please sign in to comment.