File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
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_IS_FORK=" $( jq ' .repository.fork' $GITHUB_EVENT_PATH ) "
3536export SCORECARD_BIN=" /scorecard"
3637export ENABLED_CHECKS=
3738
5051echo " Event file: $GITHUB_EVENT_PATH "
5152echo " Event name: $GITHUB_EVENT_NAME "
5253echo " Ref: $GITHUB_REF "
54+ echo " Fork repository: $SCORECARD_IS_FORK "
5355echo " Private repository: $SCORECARD_PRIVATE_REPOSITORY "
5456echo " Publication enabled: $SCORECARD_PUBLISH_RESULTS "
5557echo " Format: $SCORECARD_RESULTS_FORMAT "
5658echo " Policy file: $SCORECARD_POLICY_FILE "
5759
60+ if [[ -z " $GITHUB_AUTH_TOKEN " ]]; then
61+ echo " The 'repo_token' variable is empty."
62+
63+ if [[ " $SCORECARD_IS_FORK " == " true" ]]; then
64+ echo " We have detected you are running on a fork."
65+ fi
66+
67+ echo " Please follow the instructions at https://github.com/ossf/scorecard-action#authentication to create the read-only PAT token."
68+ exit 1
69+ fi
70+
71+
72+
5873# Note: this will fail if we push to a branch on the same repo, so it will show as failing
5974# on forked repos.
6075if [[ " $GITHUB_EVENT_NAME " != " pull_request" * ]] && ! [[ " $GITHUB_REF " =~ ^refs/heads/(main| master)$ ]]; then
You can’t perform that action at this time.
0 commit comments