File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -30,24 +30,22 @@ jobs:
3030 steps :
3131 - name : Checkout repository
3232 uses : actions/checkout@v3
33+ with :
34+ ref : ${{ github.head_ref }}
3335
3436 - name : Set up Git user configuration
3537 run : |
36- # Configure Git with a default user for automated commit reversion
3738 git config user.name "github-actions"
3839 git config user.email "github-actions@github.com"
39-
40+
4041 - name : Revert last commit
4142 run : |
42- # Retrieve the hash of the last commit
4343 LAST_COMMIT=$(git rev-parse HEAD)
4444 echo "Reverting commit: $LAST_COMMIT"
45- # Revert the last commit without prompting for a commit message
4645 git revert --no-edit $LAST_COMMIT
47-
46+
4847 - name : Push changes
4948 env :
5049 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5150 run : |
52- # Push the revert commit to the current branch
53- git push origin HEAD:${{ github.ref }}
51+ git push origin HEAD:${{ github.head_ref }}
You can’t perform that action at this time.
0 commit comments