Skip to content

Commit

Permalink
Update sync.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dmadisetti authored Apr 12, 2024
1 parent a80b245 commit 0bab641
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,16 @@ jobs:
# if main doesn't exist we should make it (new template)
git rev-parse --verify origin/main || {
git checkout -b main && git push origin main;
ERROR=$(gh issue create -a '${{ github.actor }}' -t "finish setting up template" -F ./.github/template_todo.md 2>&1)
# Check if the command succeeded or failed
if [[ $? -ne 0 ]]; then # if the command failed
ERROR=$(gh issue create -a '${{ github.actor }}' -t "finish setting up template" -F ./.github/template_todo.md 2>&1) || {
# If a "403" is in the output, then perform the following commands
if [[ -n "$ERROR" ]] && echo "$ERROR" | grep -q "403"; then
# cat .github/workflow-setup.md >> $GITHUB_STEP_SUMMARY
cat .github/workflow-setup.md >> $GITHUB_STEP_SUMMARY
echo "# Auth probz" >> $GITHUB_STEP_SUMMARY
fi
echo "\n---" >> $GITHUB_STEP_SUMMARY
echo "the raw error: $ERROR" >> $GITHUB_STEP_SUMMARY
exit 1 # make the script fail
fi
}
}
echo "::endgroup::"
env:
Expand Down

0 comments on commit 0bab641

Please sign in to comment.