Skip to content

A GitHub action to automatically revert a given commit

License

Notifications You must be signed in to change notification settings

exact-payments/revert-commit-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Github Revert Commit Action

This action reverts the given commit in the Github Action Workflow

Inputs

commit-username

Optional Username to execute commits to Github with

commit-email

Optional Email to execute commits to Github with

github-token

Required Github Action generated secret token for authentication purposes

is-push-enabled

Required Parameter to enable or disable the push of the revert (defaulting to false for safety/testing).

should-log-diff

Optional Boolean: true if git diff should be logged, false otherwise

Outputs

was-commit-reverted

Boolean: true if commit was revert, false otherwise.

reverted-commit-hash

The commit hash of the commit that was reverted.

Example usage

  # Revert commit (only should run on failure of some phase in a CI/CD pipeline)
  auto-revert-commit:
    needs: tests
    runs-on: ubuntu-latest
    if: always() && (needs.tests.result == 'failure')
    steps:
      - name: Automatic Commit Revert
        uses: 'tofu-apis/revert-commit-action@v0.0.37'
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          is-push-enabled: 'true'

About

A GitHub action to automatically revert a given commit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published