Created
August 1, 2020 16:46
-
-
Save theothertomelliott/7a0ea71ccb3dec7b6374344bfbf295a8 to your computer and use it in GitHub Desktop.
GitHub Actions Workflow to record scheduled action timing
This file contains hidden or 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: 'Scheduled' | |
on: | |
schedule: | |
- cron: '*/5 * * * *' | |
jobs: | |
scheduled: | |
name: Scheduled Job | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: 'Checkout runs branch' | |
uses: actions/checkout@master | |
with: | |
ref: runs | |
path: runs | |
- name: Update record of runs | |
run: date +%s >> runs/times.txt | |
- name: Commit | |
run: | | |
cd runs | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git add -A | |
git commit -m "Record job run" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: runs | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
directory: runs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment