Skip to content

monthly lcsh check

monthly lcsh check #32

Workflow file for this run

name: monthly lcsh check
on:
schedule:
- cron: '40/5 20 9 * *'
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: Create branch
run: git checkout -b monthly_check_$(date "+%Y%m%d-%H-%M-%S")
- name: Run script
run: |
python monthly_lcsh_check.py
- name: Commit and push changed files
run: |
git config user.name "Charlotte Kostelic"
git config user.email "[email protected]"
git add lcsh.log
git add data/*
git commit -a -m "LCSH Check $(date "+%Y%m%d-%H-%M-%S")"
git push --set-upstream origin monthly_check_$(date "+%Y%m%d-%H-%M-%S")
- name: Parse changes
run: |
echo "CHANGED=$(grep 'DEBUG - Revised' lcsh.log | grep -Eo '\[.+]$')" >> $GITHUB_ENV
echo "DEPRECATED=$(grep 'DEBUG - Deprecated' lcsh.log | grep -Eo '\[.+]$')" >> $GITHUB_ENV
- name: Create PR
run: |
echo "### Changed" >> $PR_BODY
if [[ ! -z "$CHANGED" ]];
echo "### Added" >> $PR_BODY
echo "+ New infile is: data/acc_in.csv" >> $PR_BODY
echo "+ Old infile is: data/acc_in_$DATE.csv" >> $PR_BODY
gh pr create \
--repo ${{ github.repository }} \
--assignee "$ASSIGNEES" \
--title "Monthly LCSH check ($(date "+%Y%m%d-%H-%M-%S"))" \
--body "$PR_BODY")
- name: Create Issue
if: ${{ contains(fromJSON(*), env.CHANGED) == true || contains(fromJSON(*), env.DEPRECATED) == true}}

Check failure on line 62 in .github/workflows/monthly-run.yaml

View workflow run for this annotation

GitHub Actions / monthly lcsh check

Invalid workflow file

The workflow is not valid. .github/workflows/monthly-run.yaml (Line: 62, Col: 13): Unexpected symbol: '*'. Located at position 19 within expression: contains(fromJSON(*), env.CHANGED) == true || contains(fromJSON(*), env.DEPRECATED) == true
run: |
if [[ ! -z "$CHANGED" ]];
echo "### Changed" >> $ISSUE_BODY
echo $CHANGED >> $ISSUE_BODY
if [[ ! -z "$DEPRECATED" ]];
echo "### Deprecated" >> $ISSUE_BODY
echo $DEPRECATED >> $ISSUE_BODY
gh issue create \
--title "Changes to ACC LCSH" \
--assignee "$ASSIGNEES" \
--body "$ISSUE_BODY")