Skip to content

Commit

Permalink
Add GitHub Action that will run every 30 min
Browse files Browse the repository at this point in the history
The ones that are not on the hour should be failing jobs.
  • Loading branch information
jbranchaud committed Jun 12, 2023
1 parent 83d37e8 commit 8c317de
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/scheduled-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Scheduled Actions Demo
run-name: ${{ github.actor }} is testing scheduled GitHub Actions πŸš€
on:
schedule:
- cron: '0 14-23 * * 1-5'
- cron: '30 14-23 * * 1-5'
jobs:
Scheduled-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- run: node scheduled-script.js
- run: echo "🍏 This job's status is ${{ job.status }}."
9 changes: 9 additions & 0 deletions scheduled-script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const date = new Date;

const minutes = date.getMinutes();

if(minutes === 0) {
process.exit(0)
} else {
process.exit(1)
}

0 comments on commit 8c317de

Please sign in to comment.