mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 08:55:27 +03:00
🌱 Use git diff instead of external action for changed files (#3894)
* Use git diff instead of third party action. Signed-off-by: Spencer Schrock <sschrock@google.com> * clarify approach Signed-off-by: Spencer Schrock <sschrock@google.com> --------- Signed-off-by: Spencer Schrock <sschrock@google.com>
This commit is contained in:
parent
54690b41ae
commit
4f4b44d08a
16
.github/workflows/docker.yml
vendored
16
.github/workflows/docker.yml
vendored
@ -38,15 +38,17 @@ jobs:
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
|
||||
with:
|
||||
fetch-depth: 2 # needed to diff changed files
|
||||
- id: files
|
||||
name: Get changed files
|
||||
uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 #v42.0.2
|
||||
with:
|
||||
files_ignore: '**.md'
|
||||
- id: docs_only_check
|
||||
if: steps.files.outputs.any_changed != 'true'
|
||||
name: Check for docs-only changes
|
||||
run: echo "docs_only=true" >> $GITHUB_OUTPUT
|
||||
run: |
|
||||
set +e # dont fail based on grep exit code
|
||||
git diff --name-only HEAD~1 | grep --ignore-case --invert-match '.md$'
|
||||
if [ $? -eq 1 ]; then
|
||||
# no grep match (all files end in .md) produces exit code 1
|
||||
echo "docs_only=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "docs_only=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
docker_matrix:
|
||||
strategy:
|
||||
|
Loading…
Reference in New Issue
Block a user