Skip to content

Commit 64da8aa

Browse files
authored
Merge pull request #49 from cronitorio/claude/add-cronitor-schedule-s0MGD
Add GitHub API integration to fetch workflow schedules
2 parents 0864588 + 227e4af commit 64da8aa

12 files changed

Lines changed: 53506 additions & 14320 deletions

File tree

.github/workflows/check-dist.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

2626
- name: Set Node.js 16.x
27-
uses: actions/setup-node@v3.5.0
27+
uses: actions/setup-node@v4
2828
with:
2929
node-version: 16.x
3030

@@ -44,7 +44,7 @@ jobs:
4444
id: diff
4545

4646
# If index.js was different than expected, upload the expected version as an artifact
47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
4949
with:
5050
name: dist

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
units:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- run: npm ci
1616
- run: npm test
1717

1818
# test action works running from the graph
1919
# test:
2020
# runs-on: ubuntu-latest
2121
# steps:
22-
# - uses: actions/checkout@v3
22+
# - uses: actions/checkout@v4
2323
# - uses: ./
2424
# with:
2525
# milliseconds: 1000

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
name: Send Telemetry
2828
steps:
2929
- name: Send execution details to the Cronitor for Github Actions agent
30-
uses: cronitorio/monitor-github-actions@v7
30+
uses: cronitorio/monitor-github-actions@v8
3131
with:
3232
event: ${{ toJSON(github.event) }}
3333
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -43,11 +43,10 @@ jobs:
4343
|---------------------|----------|----------------------------------------------------|
4444
| ``event`` | Yes | Triggering event (passed from ``github.event``) |
4545
| ``cronitor_key`` | Yes | Your Cronitor API key |
46-
| ``github_token`` | No | To relay workflow logs, pass your ``GITHUB_TOKEN`` |
46+
| ``github_token`` | No | Used to fetch workflow schedules from your repo |
4747
| ``cronitor_group`` | No | Add monitors to a Cronitor group |
4848
| ``cronitor_notify`` | No | A notification list to use for alerts |
49-
50-
Note: Log relay is coming soon.
49+
| ``key_format`` | No | Monitor key format: ``slugified`` (default) or ``guid`` |
5150

5251
## Monitoring Specific Workflows
5352
By default, when you add the YAML for the Cronitor Monitoring Relay as an Action, it will be invoked automatically for every
@@ -73,5 +72,12 @@ After adding the Cronitor Relay yaml, your workflows will appear on your Cronito
7372
dashboard, you will be able to customize alert preferences, including:
7473
- Be alerted only if a workflow persistently fails
7574
- Be alerted if a workflow does not run or complete at least once in a given time span.
76-
- Be alerted on workflow execution time and avoid surprise charges from Github.
75+
- Be alerted on workflow execution time and avoid surprise charges from Github.
76+
77+
## Changelog
78+
79+
### v8
80+
- **Schedule sync**: Workflows with a `schedule` trigger now automatically sync their cron schedule to Cronitor.
81+
- **Cleaner monitor keys**: Monitor keys now use a slugified workflow name format (`gh-my-workflow-name`) instead of numeric IDs.
82+
- **Backwards compatibility**: Existing users can set `key_format: guid` to keep using the old key format and preserve their existing monitors.
7783

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ inputs:
1616
cronitor_notify:
1717
description: Optionally specify a notification list or channel for alerts from this monitor
1818
required: false
19+
key_format:
20+
description: 'Monitor key format: "slugified" (default, gh-workflow-name) or "guid" (repo-id-workflow-id)'
21+
required: false
22+
default: 'slugified'
1923
branding:
2024
icon: 'activity'
2125
color: 'white'

0 commit comments

Comments
 (0)