-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Action that will run every 30 min
The ones that are not on the hour should be failing jobs.
- Loading branch information
1 parent
83d37e8
commit 8c317de
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
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 }}." |
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
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) | ||
} |