Notify ETL even if JSTOR is unchanged #19
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: Fetch Data and Notify Parent | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
notify-parent: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Run Puppeteer script | |
run: node fetchData.js | |
env: | |
JSTOR_USER: ${{ secrets.JSTOR_USER }} | |
JSTOR_PASSWORD: ${{ secrets.JSTOR_PASSWORD }} | |
JSTOR_PROJECT: ${{ secrets.JSTOR_PROJECT }} | |
- name: Commit and push new data | |
run: | | |
git config --global user.name 'martimpassos' | |
git config --global user.email 'martimpassos@users.noreply.github.com' | |
git add -f input/jstor.xls | |
if git diff --staged --quiet; then | |
echo "No changes detected, skipping commit." | |
exit 0 | |
else | |
git commit -am "Update JSTOR data" | |
git push | |
fi | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.PARENT_REPO_TOKEN }} | |
repository: imaginerio/imaginerio-etl | |
event-type: submodule-update |