Skip to content

last-successful-build-action

Actions
Action to find the sha of the last successful workflow of a branch
v1.1.4
Latest
Star (1)

Tags

 (1)

last-successful-build-action

This action searches for the last successful workflow-run for the given workflow-name and branch. The sha of the workflow-commit is set as output-parameter. If no matching workflow exists, the sha of the current run is emitted.

Usage

      - uses: actions/checkout@v3
      - name: Find matching workflow
        uses: SamhammerAG/last-successful-build-action@v4
        with:
          token: "${{ secrets.GITHUB_TOKEN }}"
          branch: "development"
          workflow: "build"

Verifying workflow run SHAs

If your workflow runs are expected to contain no-longer existing commit SHAs (e.g. when squashing and force pushing) you need to verify the SHA of the workflow run commit against the list of commit SHAs in your repository.

      - uses: actions/checkout@v3
        with:
          fetch-depth: 0 # check out the entire repo history for SHA verification
      - name: Find matching workflow
        uses: SamhammerAG/last-successful-build-action@v4
        with:
          branch: "development"
          workflow: "build"
          verify: true

Config

Action inputs

Name Description Default
token GITHUB_TOKEN or a repo scoped PAT. GITHUB_TOKEN
branch Branch for the workflow to look for. ""
workflow Workflow name to look for. ""
job Job name to look for. ""
verify Verify workflow commit SHA against list of SHAs in repository false

Action outputs

Name Description Default
sha Sha of the workflow-run matching the requirements. ${{ github.sha }}

last-successful-build-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Action to find the sha of the last successful workflow of a branch
v1.1.4
Latest

Tags

 (1)

last-successful-build-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.