GitHub Action
Get status of last workflow
v0.3.3
Latest version
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
- Secret GitHub API token to use for making API requests.
default: ${{ github.token }}
- Conclusion value of last workflow.
See https://docs.github.com/en/rest/checks/runs#create-a-check-run--parameters conclusion parameter.
jobs:
yor-job:
runs-on: ubuntu-latest
steps:
- name: Get previous workflow status
uses: Mercymeilya/[email protected]
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Any action
run: slyle-check.sh
- name: Build fixed slack message
uses: rtCamp/[email protected]
if: ${{ success() && steps.last_status.outputs.last_status == 'failure' }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: 'Style check fixed now!'