Skip to content

Commit

Permalink
feat: adding conditional check to ensure branch or PR is present (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecbuchanan authored Jun 18, 2024
1 parent 9db502f commit 44f4503
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scripts/perform_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ repo=$(echo "$CIRCLE_REPOSITORY_URL" | awk -F'[:/]' '{print $2"/"$3}' | sed 's/\
# Set the GitHub token from the environment variable
AUTH_TOKEN=${!PARAM_GITHUB_TOKEN}

if [ -z "$CIRCLE_PULL_REQUEST" ] && [ -z "$CIRCLE_BRANCH" ]; then
# Neither pull request nor branch, skip upload
echo "Neither a branch nor a pull request is present. Skipping upload."
# Conditional execution based on the presence of a pull request
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
elif [ -z "$CIRCLE_PULL_REQUEST" ]; then
# No pull request, upload results for a branch
if "${CODEQL_DIR}/codeql" github upload-results \
--repository="$repo" \
Expand Down

0 comments on commit 44f4503

Please sign in to comment.