opensource-heartbeat #917
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: opensource-heartbeat | |
on: | |
# nightly at 4:30am | |
schedule: | |
- cron: 30 4 * * * | |
jobs: | |
Update: | |
name: Generate Open Source HeartBeat Interface | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Open Source Heartbeat | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pip install requests pyyaml | |
# Clean up previous events | |
rm -rf _events/ | |
mkdir -p _events/ | |
python scripts/generate-events.py | |
- name: Push to main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
printf "GitHub Actor: ${GITHUB_ACTOR}\n" | |
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git branch | |
git add _events/* | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git status | |
if git diff-index --quiet HEAD --; then | |
printf "No changes\n" | |
else | |
printf "Changes\n" | |
git commit -a -m "Automated deployment to update events $(date '+%Y-%m-%d')" | |
git push origin main | |
fi |