You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(actions): check to install jq if it is not already (#4000)
- Change single quotes to double quotes for consistency
- Add a check to install `jq` if it is not already installed
Signed-off-by: Bo-Yi Wu <[email protected]>
Co-authored-by: Kashif Khan <[email protected]>
Co-authored-by: Nabeel Alam <[email protected]>
echo "::error::BASE and HEAD commits are the same. TruffleHog won't scan anything. Please see documentation (https://github.com/trufflesecurity/trufflehog#octocat-trufflehog-github-action)."
60
-
exit 1
61
-
fi
62
-
##########################################
63
-
## Scan commits based on event type ##
64
-
##########################################
65
-
else
66
-
if [ "${{ github.event_name }}" == "push" ]; then
67
-
COMMIT_LENGTH=$(printenv COMMIT_IDS | jq length)
68
-
if [ $COMMIT_LENGTH == "0" ]; then
69
-
echo "No commits to scan"
70
-
exit 0
52
+
53
+
git status >/dev/null # make sure we are in a git repository
echo "::error::BASE and HEAD commits are the same. TruffleHog won't scan anything. Please see documentation (https://github.com/trufflesecurity/trufflehog#octocat-trufflehog-github-action)."
67
+
exit 1
68
+
fi
69
+
##########################################
70
+
## Scan commits based on event type ##
71
+
##########################################
72
+
else
73
+
if [ "${{ github.event_name }}" == "push" ]; then
74
+
COMMIT_LENGTH=$(printenv COMMIT_IDS | jq length)
75
+
if [ $COMMIT_LENGTH == "0" ]; then
76
+
echo "No commits to scan"
77
+
exit 0
78
+
fi
79
+
HEAD=${{ github.event.after }}
80
+
if [ ${{ github.event.before }} == "0000000000000000000000000000000000000000" ]; then
0 commit comments