CI: treat all files as modified on new branches (#1826)

This commit is contained in:
el-u 2023-05-20 21:57:38 +02:00 committed by GitHub
parent 5e9bf4b007
commit 54ea917c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,7 @@ jobs:
echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV
- name: "Determine modified files (push)" - name: "Determine modified files (push)"
if: github.event_name == 'push' if: github.event_name == 'push' && github.event.before != '0000000000000000000000000000000000000000'
run: | run: |
git fetch origin $BEFORE $AFTER git fetch origin $BEFORE $AFTER
DIFF=$(git diff --diff-filter=d --name-only $BEFORE..$AFTER -- "*.py") DIFF=$(git diff --diff-filter=d --name-only $BEFORE..$AFTER -- "*.py")
@ -45,6 +45,11 @@ jobs:
echo "$DIFF" echo "$DIFF"
echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV
- name: "Treat all files as modified (new branch)"
if: github.event_name == 'push' && github.event.before == '0000000000000000000000000000000000000000'
run: |
echo "diff=." >> $GITHUB_ENV
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
if: env.diff != '' if: env.diff != ''
with: with: