Skip to content

Commit

Permalink
add is_github_actions() function to check if the current environmen…
Browse files Browse the repository at this point in the history
…t is GitHub Actions
  • Loading branch information
jamacku committed May 7, 2024
1 parent 5f90c22 commit df83fda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,15 @@ is_debug () {
return ${result}
}

# Function to check if the script is run in GitHub Actions environment
is_github_actions () {
if [[ -z "${GITHUB_ACTIONS}" ]]; then
return 1
fi

return 0
}

# Function to upload the SARIF report to GitHub
# Source: https://github.com/github/codeql-action/blob/dbe6f211e66b3aa5e9a5c4731145ed310ed54e28/lib/upload-lib.js#L104-L106
# Parameters: https://github.com/github/codeql-action/blob/69e09909dc219ed3374913e41c167490fc57202a/lib/upload-lib.js#L211-L224
Expand Down

0 comments on commit df83fda

Please sign in to comment.