Skip to content

Trigger workflow if itself is modified #8

Trigger workflow if itself is modified

Trigger workflow if itself is modified #8

Workflow file for this run

name: Update README Table

Check failure on line 1 in .github/workflows/update-table.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/update-table.yaml

Invalid workflow file

`pull` is not a valid event name
on:
push:
paths:
- 'journals.yaml'
- 'code/*_table'
- '.github/workflows/update-table.yaml'
pull:
paths:
- 'journals.yaml'
- 'code/*_table'
- '.github/workflows/update-table.yaml'
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Run table embedding script
run: python code/embed_table
- name: Check for changes in README.md
id: git-check
run: |
git diff --exit-code README.md
echo "README_CHANGED=$?" >> $GITHUB_ENV
- name: Commit changes
if: env.README_CHANGED == '1'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add README.md
git commit -m "Updated rendered table"
- name: Push changes
if: env.README_CHANGED == '1'
run: git push