Skip to content

Commit

Permalink
[PLAY-1534] Fix Github Action Bug that Breaks Build (#3655)
Browse files Browse the repository at this point in the history
**What does this PR do?** A clear and concise description with your
runway ticket url.


**Screenshots:** Screenshots to visualize your addition/change


**How to test?** Steps to confirm the desired behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See addition/change


#### Checklist:
- [ ] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [ ] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
- [ ] **TESTS** I have added test coverage to my code.
  • Loading branch information
jasperfurniss authored Sep 4, 2024
1 parent 77322df commit ac823a1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/github-actions-release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ jobs:
echo "new_ruby_version=${new_ruby_version}" >> $GITHUB_ENV
- name: Check if version exists and increment if necessary
run: |
max_attempts=2
max_attempts=10
attempt=0
current_version="${{ env.new_npm_version }}"
while [ $attempt -lt $max_attempts ]; do
if timeout 30s npm view playbook-ui@${{ env.new_npm_version }} version &>/dev/null; then
echo "Version ${{ env.new_npm_version }} already exists. Incrementing..."
new_npm_version=$(yarn version --prerelease --preid rc --no-git-tag-version | grep "New version:" | awk '{print $4}')
new_npm_version=${new_npm_version#v}
echo "new_npm_version=${new_npm_version}" >> $GITHUB_ENV
if npm view playbook-ui@$current_version version &>/dev/null; then
echo "Version $current_version already exists. Incrementing..."
current_version=$(yarn version --prerelease --preid rc --no-git-tag-version | grep "New version:" | awk '{print $4}')
current_version=${current_version#v}
else
echo "Version ${{ env.new_npm_version }} is available."
echo "Version $current_version is available."
break
fi
attempt=$((attempt+1))
Expand All @@ -73,7 +73,8 @@ jobs:
echo "Error: Maximum attempts reached. Unable to find an available version."
exit 1
fi
new_ruby_version=$(echo $new_npm_version | sed 's/-rc\./.pre.rc./')
echo "new_npm_version=${current_version}" >> $GITHUB_ENV
new_ruby_version=$(echo $current_version | sed 's/-rc\./.pre.rc./')
echo "new_ruby_version=${new_ruby_version}" >> $GITHUB_ENV
- name: Update Version.rb
run: |
Expand Down

0 comments on commit ac823a1

Please sign in to comment.