pull-data #379
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: pull-data | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '0 12 * * *' # runs at 12:00 UTC everyday | |
jobs: | |
build: | |
permissions: | |
id-token: write # Enable OIDC | |
pull-requests: write | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pipenv | |
pipenv install | |
- name: execute py script | |
env: | |
DATA_URL: ${{ secrets.DATA_URL }} | |
run: pipenv run python main.py | |
- name: gitsign | |
uses: chainguard-dev/actions/setup-gitsign@main | |
- name: commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add data.csv | |
git commit -m "update data" | |
git push origin main | |
- if: ${{ failure() && github.event_name == 'schedule' }} | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_COLOR: '#8E1600' | |
MSG_MINIMAL: 'true' | |
SLACK_TITLE: pull-data failed. | |
SLACK_MESSAGE: | | |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |