Skip to content

Commit 39e97ce

Browse files
committed
test: check if environment variable exists
1 parent 202524c commit 39e97ce

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.github/workflows/scripts/filter_git_diff.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
# Ignoring the status assigned to the file
2525
diff_filtered += file + ' '
2626

27-
# If we will at some point add paths to in diff_filter_path
28-
# we'll have to remove '/'
29-
env_var = 'CHANGED_' + diff_filter_path.upper()
30-
set_var = env_var + "=" + diff_filtered
31-
32-
with open(env_file, 'a') as file:
33-
file.write(set_var)
27+
if diff_filtered != '':
28+
# If we will at some point add paths to in diff_filter_path
29+
# we'll have to remove '/'
30+
env_var = 'CHANGED_' + diff_filter_path.upper()
31+
set_var = env_var + "=" + diff_filtered
32+
33+
with open(env_file, 'a') as file:
34+
file.write(set_var)

.github/workflows/test_new_action_based_on_dorny.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
echo "git diff --no-renames --name-status ${GITHUB_BASE_REF}..HEAD"
4343
export CHANGED=$(git diff --no-renames --name-status origin/${GITHUB_BASE_REF}..HEAD)
4444
echo $CHANGED
45-
#echo "CHANGED=${CHANGED}" >> $GITHUB_ENV
4645
python .github/workflows/scripts/filter_git_diff.py
4746
- name: Are there changed files
47+
if: env.TEST
4848
run: |
4949
echo $CHANGED_EASYSTACKS
5050
# - name: Mount EESSI CernVM-FS pilot repository

0 commit comments

Comments
 (0)