Skip to content

Commit

Permalink
testing empty variables
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottekostelic committed Apr 11, 2024
1 parent 2585da9 commit 4783098
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/monthly-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
run: |
git checkout -b monthly_check_$DATE
python monthly_lcsh_check.py
echo "CHANGED=$(grep -q 'DEBUG' lcsh.log && echo 'true' || echo 'false')" >> $GITHUB_ENV
echo "REVISED=$(grep -q 'DEBUG - Revised' lcsh.log && echo 'true' || echo 'false')" >> $GITHUB_ENV
echo "DEPRECATED=$(grep -q 'DEBUG - Deprecated' lcsh.log && echo 'true' || echo 'false')" >> $GITHUB_ENV
Expand All @@ -43,33 +44,22 @@ jobs:
echo "PR_BODY<<EOF"
echo "### Changed:"
echo " + lcsh.log updated with data from workflow run on $(date '+%D')"
echo "${{ [-z env.REVISED] == 'false' && '### Added:' && ' + New infile is: data/acc_in.csv' && ' + Old infile is: data/acc_in_$DATE' || '' }}"
echo EOF
} >> $GITHUB_ENV
- name: Create PR and Issue text (changes)
if: ${{ env.REVISED == 'true' || env.DEPRECATED == 'true '}}
if: ${{ env.CHANGED == 'true' }}
run: |
{
echo "PR_BODY<<EOF"
echo "${{ env.PR_BODY }}"
echo "### Added:"
echo " + New infile is: data/acc_in.csv"
echo " + Old infile is: data/acc_in_$DATE"
echo EOF
} >> $GITHUB_ENV
{
echo "ISSUE_BODY<<EOF"
echo "${{ env.REVISED == 'false' && '### Changed:' && '$(grep "DEBUG - Revised" lcsh.log | grep -Eo "\[.+]$")' || '$(grep -q "DEBUG - Revised" lcsh.log)' }}"
echo "${{ env.DEPRECATED == 'true' && '### Deprecated:' }}"
echo "${{ env.DEPRECATED == 'true' && '$(grep "DEBUG - Deprecated" lcsh.log | grep -Eo "\[.+]$")' }}"
echo "${{ env.REVISED == 'true' && '### Changed:' && '$(grep "DEBUG - Revised" lcsh.log | grep -Eo "\[.+]$")' || '$(grep -q "DEBUG - Revised" lcsh.log)' }}"
echo "${{ env.DEPRECATED == 'deprecated' && '### Deprecated:' && '$(grep "DEBUG - Deprecated" lcsh.log | grep -Eo "\[.+]$")' || '$(grep -q "DEBUG - Deprecated" lcsh.log)'}}"
echo EOF
} >> $GITHUB_ENV
- name: Check PR and Issue text
run: |
echo "CHANGED: ${{ env.CHANGED }}"
echo "REVISED: ${{ env.REVISED }}"
echo "DEPRECATED: ${{ env.DEPRECATED }}"
echo "CHANGED: ${{ env.CHANGED }}"
echo "PR_BODY: ${{ env.PR_BODY }}"
echo "ISSUE_BODY: ${{ env.ISSUE_BODY }}"

0 comments on commit 4783098

Please sign in to comment.