Compare commits

...

7 Commits

Author SHA1 Message Date
Joe Horsnell
67026f2125
Merge 9beb6f2184 into 3c49e64ca2 2023-12-06 20:27:47 -07:00
Michal Dorner
3c49e64ca2
Merge pull request #210 from dorny/use-nodejs-20
Update to nodejs 20
2023-12-04 21:00:07 +01:00
Michal Dorner
8ec7be4734
Update to nodejs 20 2023-12-04 20:54:44 +01:00
Michal Dorner
100a1198b2
Revert back to node16 2023-12-04 20:42:41 +01:00
Michal Dorner
96be2b61c4
Merge pull request #206 from danielhjacobs/patch-1
Update Node.js to version 20
2023-12-04 20:37:19 +01:00
Daniel Jacobs
f5071954e8
Update Node.js to version 20 2023-10-25 13:21:33 -04:00
Joe Horsnell
9beb6f2184 Update docs to clarify schedule event usage
Related to #100 (can't say it fixes it, but at least clarifies usage), this PR adds a section to the
docs to explain how to handle using this action in a workflow triggered by a [`schedule` event][1].

[1]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
2022-02-28 18:05:47 +00:00
4 changed files with 37 additions and 9 deletions

View File

@ -70,6 +70,34 @@ For more scenarios see [examples](#examples) section.
- Local execution with [act](https://github.com/nektos/act) works only with alternative runner image. Default runner doesn't have `git` binary.
- Use: `act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04`
### Schedule events (cron)
Workflows triggered by [`schedule` events](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) (ie cron) must be given special consideration when using this action. As per the GitHub docs:
> Scheduled workflows run on the latest commit on the default or base branch
Unlike for `pull_request` or `push` events, where there's an associated commit (or set of commits) for the branch in question, schedule events are based on time, so there is nothing to compare against, other than maybe "the time of the last run", but that timing cannot be guaranteed.
As such, there is no GitHub Actions webhook payload for schedule events, so when the action tries to calculate the set of changes, it will error:
`This action requires 'base' input to be configured or 'repository.default_branch' to be set in the event payload`
It's recommended for workflows that will be triggered by a schedule event, to either set the `base` property, or explicitly check for a scheduled event and handle as required (eg always run, or never run, whatever the requirement is). For example, for steps within a single job:
```yaml
- uses: dorny/paths-filter@v2
id: changes
if: github.event_name != 'schedule'
with:
filters: |
src:
- 'src/**'
# run only if triggered by a schedule event, or some file in 'src' folder was changed
- if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true'
run: ...
```
## What's New
- Add `ref` input parameter

View File

@ -48,7 +48,7 @@ outputs:
changes:
description: JSON array with names of all filters matching any of changed files
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
branding:
color: blue

14
package-lock.json generated
View File

@ -23,7 +23,7 @@
"@types/picomatch": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"@vercel/ncc": "^0.33.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.17.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^22.21.0",
@ -1994,9 +1994,9 @@
}
},
"node_modules/@vercel/ncc": {
"version": "0.33.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.1.tgz",
"integrity": "sha512-Mlsps/P0PLZwsCFtSol23FGqT3FhBGb4B1AuGQ52JTAtXhak+b0Fh/4T55r0/SVQPeRiX9pNItOEHwakGPmZYA==",
"version": "0.38.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz",
"integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
@ -9991,9 +9991,9 @@
}
},
"@vercel/ncc": {
"version": "0.33.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.1.tgz",
"integrity": "sha512-Mlsps/P0PLZwsCFtSol23FGqT3FhBGb4B1AuGQ52JTAtXhak+b0Fh/4T55r0/SVQPeRiX9pNItOEHwakGPmZYA==",
"version": "0.38.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz",
"integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==",
"dev": true
},
"abab": {

View File

@ -39,7 +39,7 @@
"@types/picomatch": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"@vercel/ncc": "^0.33.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.17.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^22.21.0",