File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export SCORECARD_RESULTS_FORMAT="$INPUT_RESULTS_FORMAT"
3232export SCORECARD_PUBLISH_RESULTS=" $INPUT_PUBLISH_RESULTS "
3333# https://docs.github.com/en/actions/learn-github-actions/environment-variables
3434export SCORECARD_PRIVATE_REPOSITORY=" $( jq ' .repository.private' $GITHUB_EVENT_PATH ) "
35+ export SCORECARD_DEFAULT_BRANCH=" refs/heads/$( jq -r ' .repository.default_branch' $GITHUB_EVENT_PATH ) "
3536export SCORECARD_BIN=" /scorecard"
3637export ENABLED_CHECKS=
3738
@@ -54,12 +55,13 @@ echo "Private repository: $SCORECARD_PRIVATE_REPOSITORY"
5455echo " Publication enabled: $SCORECARD_PUBLISH_RESULTS "
5556echo " Format: $SCORECARD_RESULTS_FORMAT "
5657echo " Policy file: $SCORECARD_POLICY_FILE "
58+ echo " Default branch: $SCORECARD_DEFAULT_BRANCH "
5759
5860# Note: this will fail if we push to a branch on the same repo, so it will show as failing
5961# on forked repos.
60- if [[ " $GITHUB_EVENT_NAME " != " pull_request" * ]] && ! [[ " $GITHUB_REF " =~ ^refs/heads/(main | master)$ ]]; then
62+ if [[ " $GITHUB_EVENT_NAME " != " pull_request" * ]] && [[ " $GITHUB_REF " != " $SCORECARD_DEFAULT_BRANCH " ]]; then
6163 echo " $GITHUB_REF not supported with '$GITHUB_EVENT_NAME ' event."
62- echo " Only the default branch is supported"
64+ echo " Only the default branch ' $SCORECARD_DEFAULT_BRANCH ' is supported"
6365 exit 1
6466fi
6567
You can’t perform that action at this time.
0 commit comments