Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update semantic-release job to utilize bash instead of js #585

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,20 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run semantic-release
uses: actions/github-script@v6
with:
script: |
const { exec: execCommand } = require('@actions/exec');
const maxRetry = 3;
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
for (let attempt = 1; attempt <= maxRetry; attempt++) {
try {
await execCommand('yarn', ['semantic-release']);
break;
} catch (error) {
if (attempt < maxRetry) {
console.error(`Attempt ${attempt} failed. Retrying in 60 seconds...`);
await delay(60000);
} else {
throw error;
}
}
}
run: |
maxRetry=3
delay=60
for attempt in $(seq 1 $maxRetry); do
if yarn semantic-release; then
break
elif [ $attempt -lt $maxRetry ]; then
echo "Attempt $attempt failed. Retrying in $delay seconds..."
sleep $delay
else
echo "All attempts failed."
exit 1
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Loading