ci: Fix lint check status update (#2224)

* ci: Fix lint check status update

The lint workflow is not important for this PR, but a fixed requirement to pass for merging.

As this workflow is triggered by `schedule` or `workflow_dispatch`, it will not trigger other events such as `pull_request` for other workflows to respond to.

Since the linting workflow is not important for this type of PR, we can pretend it was "skipped" and set the check status to "success". This is simpler than running the actual Lint workflow redundantly.

* ci: Remove workflow_run approach

This didn't work out, reverting.
This commit is contained in:
Brennan Kinney 2021-09-29 09:13:58 +13:00 committed by GitHub
parent f2c4712c4f
commit 7b4ce69c3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View file

@ -41,3 +41,22 @@ jobs:
PATH: '/CONTRIBUTORS.md'
COMMIT_MESSAGE: 'docs(CONTRIBUTORS): update contributors'
AVATAR_SHAPE: 'round'
# This workflow will not trigger a `pull_request` event without a PAT.
# The lint workflow is not important for this type of PR, skip it and pretend it was successful:
- name: 'Get the latest commit hash from the contributors-update branch'
id: commit-data
run: 'echo "::set-output name=head_sha::$(git rev-parse contributors-update)"'
- name: 'Commit Status: Set Lint status to success (skipped)'
uses: myrotvorets/set-commit-status-action@1.1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Skipped workflows are still assigned a "success" status:
status: success
# This should be the correct commit SHA on the contributors-update branch:
sha: ${{ steps.commit-data.outputs.head_sha }}
# Name of status check to add/update:
context: 'lint'
# Optional message/note we can inline to the right of the context name in the UI:
description: "Lint skipped. Not relevant."

View file

@ -6,11 +6,6 @@ on:
push:
branches:
- master
# These workflows when done will trigger this workflow too:
workflow_run:
workflows: ['Update contributors']
types:
- completed
jobs:
lint: