Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
arrow-left

GitHub Action

Get status of last workflow

v0.2

Get status of last workflow

arrow-left

Get status of last workflow

Get conclusion of last workflow run on current branch

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get status of last workflow

uses: MercymeIlya/last-workflow-status@v0.2

Learn more about this action in MercymeIlya/last-workflow-status

Choose a version

License: MIT

Last workflow status

Simple GitHub action to get previous workflow conclusion/status. Was inspired by sending notification after build status changing in Travis CI.

notifications:
  slack:
    rooms: slack_room
    on_success: change

Inputs:

github_token

  • Secret GitHub API token to use for making API requests.
    default: ${{ github.token }}

Outputs:

last_status

  • Conclusion value of last workflow. success | failure

Example usage

jobs:
  yor-job:
    runs-on: ubuntu-latest
    steps:
      - name: Get previous workflow status
        uses: Mercymeilya/last-workflow-status@v0.2
        id: last_status
        with:
          - github_token: ${{ secrets.GITHUB_TOKEN }}

      - name: Any action
        run: slyle-check.sh

      - name: Build fixed slack message
        uses: rtCamp/action-slack-notify@v2.1.3
        if: ${{ success() && steps.last_status.outputs.last_status == 'failure' }}
        env: 
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
          SLACK_MESSAGE: 'Style check fixed now!'