Skip to content

Commit c935f68

Browse files
Merge pull request #21470 from cevich/simpler_to_read_followup
Secret-scanning followup fixes
2 parents 4b90bfb + c5c0799 commit c935f68

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/scan-secrets.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,22 @@ jobs:
7777
# Provide handy URL for examination of secret leaks for all events that
7878
# trigger this action.
7979

80-
- if: github.event_name == 'synchronize' || github.base_ref == ''
80+
- if: github.event.action == 'synchronize' || github.base_ref == ''
8181
name: Provide URL showing code that needs human eyes (force-push or merge)
8282
shell: bash
8383
run: |
84+
if [[ "$before" =~ ^0000+ ]]; then # Push to new branch (i.e. renovate branch)
85+
echo "Please review newly opened branch for secret-leaks:"
86+
# The event JSON provides the URL we need
87+
jq -r -e '.compare' $GITHUB_EVENT_PATH
88+
return 0
89+
fi
8490
echo "Please review force-push or merged-pr changes for secret-leaks:"
8591
before=$(jq -r -e '.before' $GITHUB_EVENT_PATH)
8692
after=$(jq -r -e '.after' $GITHUB_EVENT_PATH)
8793
echo "https://github.com/${{ github.repository }}/compare/${before}...${after}"
8894
89-
- if: github.event_name == 'opened'
95+
- if: github.event.action == 'opened'
9096
name: Provide URL showing code that needs human eyes (newly opened PR)
9197
shell: bash
9298
run: |

0 commit comments

Comments
 (0)