Skip to content

Commit 40c4ff6

Browse files
authored
fix(ci): store json commit info in variable (#754)
1 parent f925d99 commit 40c4ff6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/trufflehog.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- shell: bash
11+
env:
12+
JSON_STRING: ${{ toJson(github.event.commits) }}
1113
run: |
1214
if [ "${{ github.event_name }}" == "push" ]; then
13-
echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV
15+
printf '%s\n' "$JSON_STRING" > commit_info.json
16+
echo "depth=$(($(jq length < commit_info.json) + 2))" >> $GITHUB_ENV
1417
echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV
1518
fi
1619
if [ "${{ github.event_name }}" == "pull_request" ]; then

0 commit comments

Comments
 (0)