Update Templates for Monitored Projects (cron) #697
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: Update Templates for Monitored Projects (cron) | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
jobs: | |
update: | |
name: Update Templates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Update templates | |
run: python update_templates.py | |
- name: Determine which templates were updated | |
id: templates | |
run: | | |
echo "::set-output name=updated_templates::$(cat updated_templates.txt)" | |
- name: Delete updated templates file | |
run: rm updated_templates.txt | |
- name: Commit changes (new templates + last run time) | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '.' | |
default_author: github_actions | |
message: "Templates updated: ${{ steps.templates.outputs.updated_templates }}" | |
push: true | |
pull: '' | |
new_branch: '' | |