Skip to content

Commit

Permalink
Merge pull request #4 from jbranchaud/jb/add-scheduled-github-action
Browse files Browse the repository at this point in the history
Add GitHub Action that will run every 30 min
  • Loading branch information
jbranchaud committed Jun 12, 2023
2 parents 83d37e8 + 8c317de commit e794ff4
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 e794ff4

Please sign in to comment.