From 5830c886d36c0c18ec84c67076229ff5fada7ac6 Mon Sep 17 00:00:00 2001 From: Guang Yang Date: Tue, 17 Sep 2024 14:46:01 -0700 Subject: [PATCH] Add an error message to help debug issue when accessing secrets in the CI --- .github/workflows/trunk.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index f144edc8a1f..1d82a166ced 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -392,6 +392,10 @@ jobs: echo "::endgroup::" echo "::group::Set up HuggingFace Dependencies" + if [ -z "$SECRET_EXECUTORCH_HF_TOKEN" ]; then + echo "::error::SECRET_EXECUTORCH_HF_TOKEN is empty. For security reason secrets won't be accessible on forked PRs. Please make sure you submit a non-forked PR." + exit 1 + fi pip install -U "huggingface_hub[cli]" huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN pip install accelerate sentencepiece