Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new reusable TypeScript GitHub Action (actions/advanced-triggers) that evaluates workflow/job “triggers” based on changed files (with explicit exclusion semantics) and event types, intended to replace many dorny/paths-filter conditional patterns.
Changes:
- Added the
advanced-triggersaction implementation (event parsing, changed-file detection via GitHub API or git diff, YAML-driven trigger evaluation, and outputs). - Added action documentation and local testing artifacts (README + scripts + sample YAML/payload).
- Updated
pnpm-lock.yamlfor the new action’s dependencies.
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds dependency graph entries for the new actions/advanced-triggers workspace package. |
| actions/advanced-triggers/action.yml | Defines action inputs/outputs and node runtime entrypoint. |
| actions/advanced-triggers/package.json | Declares dependencies for the new action package. |
| actions/advanced-triggers/project.json | Adds Nx build/typecheck/test targets for the action. |
| actions/advanced-triggers/tsconfig.json | TypeScript config for the action. |
| actions/advanced-triggers/tsconfig.spec.json | TypeScript config for tests. |
| actions/advanced-triggers/src/index.ts | Entrypoint that invokes the action runtime. |
| actions/advanced-triggers/src/run.ts | Orchestrates input parsing, changed-file detection, trigger evaluation, and output emission. |
| actions/advanced-triggers/src/run-inputs.ts | Implements input + invoke-context parsing (including local debug mode mapping). |
| actions/advanced-triggers/src/event.ts | Extracts normalized event data for supported GitHub event types. |
| actions/advanced-triggers/src/filters.ts | Parses YAML configs and applies exclusion-first + positive match trigger semantics. |
| actions/advanced-triggers/src/git.ts | Computes changed files via git diff (currently with a git pull retry path). |
| actions/advanced-triggers/src/github.ts | Retrieves PR changed files via the GitHub API (paginate listFiles). |
| actions/advanced-triggers/src/tests/index.test.ts | Adds a placeholder test scaffold. |
| actions/advanced-triggers/scripts/test.sh | Local script for building/running the action with a simulated event payload. |
| actions/advanced-triggers/scripts/payload.json | Sample event payload for local testing. |
| actions/advanced-triggers/scripts/file-sets.yml | Example file-set definitions used by the local test script. |
| actions/advanced-triggers/scripts/triggers.yml | Example trigger definitions used by the local test script. |
| actions/advanced-triggers/README.md | User-facing documentation for configuration, semantics, and local testing. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chainchad
left a comment
There was a problem hiding this comment.
LG! Might as well upgrade the node version though.
| @@ -0,0 +1,41 @@ | |||
| # Trigger using inclusion-sets and exclusion-sets. | |||
| # always-trigger-on defaults to [schedule, workflow_dispatch]. | |||
| ccip: | |||
There was a problem hiding this comment.
Are these triggers specific to the /chainlink repo? If so, I might move this file there and pass in a path to that file as input to this action to make this more generic?
| description: "JSON array of trigger names that did not match" | ||
|
|
||
| runs: | ||
| using: "node20" |
There was a problem hiding this comment.
| using: "node20" | |
| using: "node24" |
v20 goes EOL next month
Adds a new reusable typescript action
advanced-triggerswhich can be used to replace a lot of the conditional triggers that we usingdorny/paths-filterto rely on. This can essentially further process GHA events/triggers so you can make job run conditions more granular.See the README.md for more detailed information on this.
Testing
I tested a lot of the functionality by migrating our complex conditions in
ci-core- smartcontractkit/chainlink#21627.Before
After
Note: it is about the same length in terms of overall lines here. However, the after is also more granular than the
dorny/paths-filterone so we should be able to skip unnecessary jobs more often.Unit tests
Second PR to follow this one that unit tests the complex parsing and filtering logic. That will also include a changeset for versioning.
DX-3534