Skip to content

Commit

Permalink
fix: Fix rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
yeha98555 committed Jun 17, 2023
1 parent 7824f57 commit d1578d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Deploy to Render
on:
push:
branches:
- main
- develop
- fix/github-actions-rollback

jobs:
test:
Expand All @@ -31,7 +30,13 @@ jobs:
- name: Rollback
if: ${{ failure() && github.event_name == 'push' }}
run: |
git checkout ${{ github.sha }}^1
if [[ "${{ steps.determine_event.outputs.event }}" == "pull_request" ]]; then
git revert -m 1 ${{ github.event.pull_request.head.sha }}
elif [[ "${{ steps.determine_event.outputs.event }}" == "push" ]]; then
git revert -n HEAD
else
echo "Unknown event type"
fi
git push --force
# Post a comment on the pull request
Expand Down

0 comments on commit d1578d8

Please sign in to comment.