Files
shaka-player/.github/workflows/custom-actions/set-commit-status/action.yaml
T
Workflow config file is invalid. Please check your config file: invalid jobs: input node is not a mapping node
Joey Parrish df3e131392 ci: Fix reporting status from lab tests to PRs (#4541)
We were misreading the computed ref for tests (missing "outputs" in the
variable name), which led us to check out and test main instead of the
PR's head. This also led us to set status on the latest commit in main,
instead of on the PR.

Once the variable was read correctly and the correct ref was checked
out, I found that the ref argument to set-commit-status was actually not
usable, since "git rev-parse refs/pull/4528/head" would fail. But now
that we are checking out the correct commit, the ref argument turns out
to be unnecessary. Whatever we checked out is what we should report
status on.
2022-10-04 12:00:39 -07:00

38 lines
1.2 KiB
YAML

name: Set Commit Status
description: |
A reusable action that sets the commit status. This is used to set PR status
from workflows with non-PR triggers (such as manually-triggered workflows).
inputs:
context:
description: An arbitrary string to identify the status check.
required: true
state:
description: Either "pending", "error", "success", or "failure".
required: true
token:
description: A GitHub access token.
required: true
runs:
using: composite
steps:
- name: Report Commit Status
shell: bash
run: |
# This is the URL to view this workflow run on GitHub. It will be
# attached to the commit status, so that when someone clicks "details"
# next to the status on the PR, it will link to this run where they can
# see the logs.
RUN_URL="https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
SHA1=$(git rev-parse HEAD)
GITHUB_TOKEN=${{ inputs.token }} \
gh api \
-X POST \
-F "context=${{ inputs.context }}" \
-F "state=${{ inputs.state }}" \
-F "target_url=$RUN_URL" \
"repos/${{ github.repository }}/statuses/$SHA1"