monthly lcsh check #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: monthly lcsh check | |
on: | |
schedule: | |
- cron: '40 15 9 * *' | |
jobs: | |
monthly-run: | |
name: Run monthly LCSH check | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
ASSIGNEES: charlottekostelic | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Set date | |
run: | | |
echo "DATE=$(date "+%Y%m%d-%H-%M-%S")" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r dev-requirements.txt | |
python -m pip install -r requirements.txt | |
- name: Create branch | |
run: git checkout -b monthly_check_$DATE | |
- 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" | |
git push --set-upstream origin monthly_check_$DATE | |
- name: Create PR and issue | |
run: | | |
git diff --quiet -- data/ && pr_url=$(gh pr create \ | |
--repo ${{ github.repository }} \ | |
--assignee "$ASSIGNEES" \ | |
--title "Monthly LCSH check ($DATE)" \ | |
--body "$PR_NO_ADD") | |
git diff --quiet -- data/ || new_issue_url=$(gh issue create \ | |
--title "$TITLE" \ | |
--assignee "$ASSIGNEES" \ | |
--body "$ISSUE_BODY") | |
git diff --quiet -- data/ || new_terms_pr_url=$(gh pr create \ | |
--repo ${{ github.repository }} \ | |
--assignee "$ASSIGNEES" \ | |
--title "Monthly LCSH check ($DATE)" \ | |
--body "$PR_ADD") | |
env: | |
ISSUE_TITLE: Changes to ACC LCSH | |
ISSUE_BODY: | | |
### Changed: | |
+ Updated list of terms in: data/acc_in.csv | |
+ See lcsh.log for lists of changed and deprecated terms | |
PR_ADD: | | |
### Changed | |
+ lcsh.log | |
### Added | |
+ data/* | |
PR_NO_ADD: | | |
### Changed | |
+ lcsh.log |