Skip to content

monthly lcsh check

monthly lcsh check #40

Workflow file for this run

name: monthly lcsh check
on:
schedule:
- cron: '45/5 13 10 * *'
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")
- 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")"
git push --set-upstream origin monthly_check_$(date "+%Y%m%d-%H-%M")
- name: Parse changes
id: changes
env:

Check failure on line 44 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: 44, Col: 13): Unexpected value '' .github/workflows/monthly-run.yaml (Line: 65, Col: 13): Unexpected symbol: '{}'. Located at position 42 within expression: toJSON(steps.changes.outputs.CHANGED) != {} || toJSON(steps.changes.outputs.DEPRECATED) != {}
run: |
echo "CHANGED=$(grep 'DEBUG - Revised' lcsh.log | grep -Eo '\[.+]$')" >> $GITHUB_OUTPUT
echo "DEPRECATED=$(grep 'DEBUG - Deprecated' lcsh.log | grep -Eo '\[.+]$')" >> $GITHUB_OUTPUT
- name: Create PR
run: |
echo "### Changed" >> $PR_BODY
echo "+ lcsh.log updated with data from workflow" >> $PR_BODY
if [[ toJSON(steps.changes.outputs.CHANGED) != {} || toJSON(steps.changes.outputs.DEPRECATED) != {} ]];
echo "### Added" >> $PR_BODY
echo "+ New infile is: data/acc_in.csv" >> $PR_BODY
echo "+ Old infile is: data/acc_in_$(date "+%Y%m%d").csv" >> $PR_BODY
gh pr create \
--repo ${{ github.repository }} \
--assignee "$ASSIGNEES" \
--title "Monthly LCSH check ($(date "+%Y%m%d-%H-%M"))" \
--body "$PR_BODY")
- name: Create Issue
if: ${{ toJSON(steps.changes.outputs.CHANGED) != {} || toJSON(steps.changes.outputs.DEPRECATED) != {} }}
run: |
if [[ ! -z ${{ steps.changes.outputs.CHANGED }} ]];
echo "### Changed" >> $ISSUE_BODY
echo ${{ steps.changes.outputs.CHANGED }} >> $ISSUE_BODY
if [[ ! -z ${{ steps.changes.outputs.DEPRECATED }} ]];
echo "### Deprecated" >> $ISSUE_BODY
echo ${{ steps.changes.outputs.DEPRECATED }} >> $ISSUE_BODY
gh issue create \
--title "Changes to ACC LCSH ($(date "+%Y%m%d-%H-%M"))" \
--assignee "$ASSIGNEES" \
--body "$ISSUE_BODY")