Checks #549
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: Checks | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '39 2 * * 1-5' | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
deployments: write | |
id-token: write | |
issues: write | |
discussions: write | |
packages: write | |
pages: write | |
pull-requests: write | |
repository-projects: write | |
security-events: write | |
statuses: write | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Checkout persistent data | |
uses: actions/checkout@v3 | |
with: | |
ref: data | |
fetch-depth: 0 | |
path: data | |
- name: Setup environment | |
run: | | |
echo "GITHUB_ACTOR=${{ github.actor }}" >> $GITHUB_ENV | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
echo "GITHUB_REPO=${{ github.repository }}" >> $GITHUB_ENV | |
- name: Dependencies | |
run: | | |
pip install --user -r requirements.txt | |
- name: Run checks | |
run: | | |
python checks/all.py | |
- name: Commit persistent data | |
run: | | |
cd data | |
if [ ! -z "$(git status --porcelain)" ]; then | |
git config --global credential.helper "" | |
git config --global --add credential.helper store | |
echo "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com" >> ~/.git-credentials | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git config user.name "${{ github.actor }}" | |
git add -A | |
git commit --amend -m "Persistent data update" | |
git push --force | |
fi |