Skip to content

removed echo

removed echo #62

Workflow file for this run

name: monthly lcsh check
on:
push:
branches:
- github-actions
# on:
# schedule:
# - cron: '* 9 15 * *'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
ASSIGNEES: charlottekostelic
jobs:
monthly-run:
name: Run monthly LCSH check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Get date var
run: echo "DATE=$(date "+%Y%m%d-%H-%M-%S")" >> $GITHUB_ENV
- name: Create branch, run script
run: |
git checkout -b monthly_check_$DATE
python monthly_lcsh_check.py
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
- name: Create PR text (no changes)
run: |
{
echo "PR_BODY<<EOF"
echo "### Changed:"
echo " + lcsh.log updated with data from workflow run on $(date '+%D')"
echo EOF
} >> $GITHUB_ENV
- name: Create PR and Issue text (changes)
if: ${{ env.REVISED == 'true' || env.DEPRECATED == '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 "REVISED_LIST=$(grep 'DEBUG - Revised' lcsh.log | grep -Eo '\[.+]$')"
echo "DEPRECATED_LIST=$(grep 'DEBUG - Deprecated' lcsh.log | grep -Eo '\[.+]$')"
{
echo "ISSUE_BODY<<EOF"
echo "${{ env.REVISED == 'true' && '### Changed:'}}"
echo "${{ env.REVISED == 'true' && '$REVISED_LIST' }}"
echo "${{ env.DEPRECATED == 'true' && '### Deprecated:' }}"
echo "${{ env.DEPRECATED == 'true' && '$DEPRECATED_LIST' }}"
echo EOF
} >> $GITHUB_ENV
- name: Check PR and Issue text
run: |
echo "CHANGED: ${{ env.CHANGED }}"
echo "REVISED: ${{ env.REVISED }}"
echo "DEPRECATED: ${{ env.DEPRECATED }}"
echo "PR_BODY: ${{ env.PR_BODY }}"
echo "ISSUE_BODY: ${{ env.ISSUE_BODY }}"