From 54ea917c48b90f0e40250964c26ccd39d3520960 Mon Sep 17 00:00:00 2001 From: el-u <109771707+el-u@users.noreply.github.com> Date: Sat, 20 May 2023 21:57:38 +0200 Subject: [PATCH] CI: treat all files as modified on new branches (#1826) --- .github/workflows/analyze-modified-files.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analyze-modified-files.yml b/.github/workflows/analyze-modified-files.yml index 7e5da43a..ba266080 100644 --- a/.github/workflows/analyze-modified-files.yml +++ b/.github/workflows/analyze-modified-files.yml @@ -37,7 +37,7 @@ jobs: echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV - name: "Determine modified files (push)" - if: github.event_name == 'push' + if: github.event_name == 'push' && github.event.before != '0000000000000000000000000000000000000000' run: | git fetch origin $BEFORE $AFTER DIFF=$(git diff --diff-filter=d --name-only $BEFORE..$AFTER -- "*.py") @@ -45,6 +45,11 @@ jobs: echo "$DIFF" 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 if: env.diff != '' with: