Skip to content

Github Action: prevent deployments when the commit SHA and deployment SHA is the same

License

Notifications You must be signed in to change notification settings

utrustdev/action-should-deploy

Repository files navigation

Github Action - Prevent deployments when no new changes

Prevent deployments when the commit SHA and deployment SHA is the same

Usage

jobs:
  deploy:
    steps:
      - name: Should Deploy?
        id: should-deploy
        uses: utrustdev/[email protected]
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Output

jobs:
  deploy:
    steps:
      ....
      - name: Get output
        run: |
          echo "output: ${{ steps.should-deploy.outputs.is_deployable }}"
          echo "sha: ${{ steps.should-deploy.outputs.sha }}"

Example

jobs:
  deploy:
    steps:
      ....
      - name: Trigger Deploy
        if: ${{ steps.should-deploy.outputs.is_deployable == 'true' }}
        uses: ....
        with:
          ....

About

Github Action: prevent deployments when the commit SHA and deployment SHA is the same

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •