Skip to content

Commit 838fd38

Browse files
author
Johannes Schneider
committed
feat: exclude the current workflow from the checks that need to pass
1 parent 912db4d commit 838fd38

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/actions/pr-is-mergeable/action.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ inputs:
1717
description: "The GitHub access token (with PR read permissions) to access the PR"
1818
required: false
1919
default: ${{ github.token }}
20+
excluded-check-runs:
21+
description: "A comma-separated list of workflow names that are excluded from the Check Runs check"
22+
required: false
23+
default: "${{ github.workflow }}"
2024

2125
outputs:
2226
pr-number:
@@ -59,6 +63,11 @@ runs:
5963
6064
# check runs are things like our CI pipeline
6165
FAILED_CHECK_RUNS=$(jq -r '.[] | select(.__typename == "CheckRun" and .conclusion != "SUCCESS" and .conclusion != "NEUTRAL")' <<< "$PR_ROLLUP")
66+
IFS=',' read -ra EXCLUDED_WORKFLOWS <<< "${{ inputs.excluded-check-runs }}"
67+
for EXCLUDED_WORKFLOW in "${EXCLUDED_WORKFLOWS[@]}"; do
68+
FAILED_CHECK_RUNS=$(jq -r '.[] | select(.name != "$EXCLUDED_WORKFLOW")' <<< "$FAILED_CHECK_RUNS")
69+
done
70+
6271
if [[ -n "$FAILED_CHECK_RUNS" ]]; then
6372
echo "PR #$PR_NUMBER (in ${{ inputs.repo }}) contains failed check runs: "
6473
echo "$FAILED_CHECK_RUNS"

0 commit comments

Comments
 (0)