Skip to content

Instantly share code, notes, and snippets.

@theothertomelliott
Created August 1, 2020 16:46
Show Gist options
  • Save theothertomelliott/7a0ea71ccb3dec7b6374344bfbf295a8 to your computer and use it in GitHub Desktop.
Save theothertomelliott/7a0ea71ccb3dec7b6374344bfbf295a8 to your computer and use it in GitHub Desktop.
GitHub Actions Workflow to record scheduled action timing
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 "action@github.com"
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