Skip to content

Commit 2b8a19c

Browse files
authored
Fixed #6 Migrated Cron jobs to Github Actions
1 parent b855d92 commit 2b8a19c

File tree

7 files changed

+59
-24
lines changed

7 files changed

+59
-24
lines changed

.github/workflows/check-python-eol-actions.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Check Python Version End of Life
22
on:
33
workflow_dispatch:
4-
repository_dispatch:
5-
types: [check_python_eol]
64
schedule:
75
- cron: '0 14 * * *' # 2pm UTC == 9am EST
86
jobs:

.github/workflows/check-tutorials-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Check Tutorials for Warnings and Errors
22
on:
33
workflow_dispatch:
4-
repository_dispatch:
5-
types: [check_tutorials]
4+
schedule:
5+
- cron: '0 14 * * *' # 2pm UTC == 9am EST
66
jobs:
77
check_tutorials:
88
runs-on: ubuntu-latest

.github/workflows/check-url-links-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Check URL Links
22
on:
33
workflow_dispatch:
4-
repository_dispatch:
5-
types: [check_url_links]
4+
schedule:
5+
- cron: '0 14 * * *' # 2pm UTC == 9am EST
66
jobs:
77
check_url_links:
88
runs-on: ubuntu-latest

.github/workflows/numba-python-compatibility-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Numba-Python Compatibility Check
22
on:
33
workflow_dispatch:
4-
repository_dispatch:
5-
types: [check_numba_python_compatibility]
4+
schedule:
5+
- cron: '0 14 * * *' # 2pm UTC == 9am EST
66
jobs:
77
check_numba_python_compatibility:
88
env:

.github/workflows/numba-release-candidate-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Numba Release Candidate Check
22
on:
33
workflow_dispatch:
4-
repository_dispatch:
5-
types: [check_numba_release_candidate]
4+
schedule:
5+
- cron: '0 14 * * *' # 2pm UTC == 9am EST
66
jobs:
77
check_numba_release_candidate:
88
runs-on: ubuntu-latest

.github/workflows/ray-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Check Ray
22
on:
33
workflow_dispatch:
4-
repository_dispatch:
5-
types: [check_ray]
4+
schedule:
5+
- cron: '0 14 * * *' # 2pm UTC == 9am EST
66
jobs:
77
check_ray:
88
runs-on: ${{ matrix.os }}

README.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,52 @@ In your repository of interest:
2525
6. Specify an environment variable name as `ACCESS_TOKEN` and paste your PAT from
2626
7. Access this environment in your workfow via `environment: API_Access` and reference the secret via `${{ secrets.ACCESS_TOKEN }}`
2727

28-
# Triggering the Workflow
29-
30-
At cron-job.org:
31-
32-
1. Choose an appropirate title
33-
2. Set the dispatch URL (e.g., `https://api.github.com/repos/stumpy-dev/automate/dispatches`)
34-
3. Select an execution schedule
35-
4. Click on the "Advanced" tab
36-
5. Add a `Accept:application/vnd.github.v3+json` key-value header
37-
6. Add a `Authorization:token <Personal_Access_Token>` key-value header
38-
7. Change the "Request Method" to "POST"
39-
8. And add a `{"event_type": "check_numba_python_compatibility"}` Request body
28+
# Allow Manual Workflow Triggering
29+
30+
In the workflow, add:
31+
32+
```
33+
on:
34+
workflow_dispatch:
35+
```
36+
37+
This will allow you to manually trigger the workflow within the Actions tab of Github
38+
39+
# Schedule Cron Job within Github Actions
40+
41+
In the workflow, add:
42+
43+
```
44+
on:
45+
# workflow_dispatch:
46+
schedule:
47+
- cron: '0 14 * * *' # 2pm UTC == 9am EST
48+
```
49+
50+
~~
51+
# Triggering the Workflow Externally Via Github API
52+
53+
In the workflow, specify the `event_type` through the `repository_dispatch` custom event trigger:
54+
55+
```
56+
on:
57+
# workflow_dispatch:
58+
# schedule:
59+
# - cron: '0 14 * * *' # 2pm UTC == 9am EST
60+
repository_dispatch:
61+
types: [check_numba_python_comptability]
62+
```
63+
64+
Then, this can be triggered through the Github API via cron-job.org:
65+
66+
1. Login to cron-job.org
67+
2. Create a new cron job
68+
3. Choose an appropirate title
69+
4. Set the dispatch URL (e.g., `https://api.github.com/repos/stumpy-dev/automate/dispatches`)
70+
5. Select an execution schedule
71+
6. Click on the "Advanced" tab
72+
7. Add a `Accept:application/vnd.github.v3+json` key-value header
73+
8. Add a `Authorization:token <Personal_Access_Token>` key-value header
74+
9. Change the "Request Method" to "POST"
75+
10. And add a `{"event_type": "check_numba_python_compatibility"}` Request body
76+
~~

0 commit comments

Comments
 (0)