Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dorny committed Feb 15, 2024
2 parents 245527a + 1441771 commit 5da0e4c
Show file tree
Hide file tree
Showing 10 changed files with 39,256 additions and 46,181 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "Build"

on:
push:
paths-ignore: [ '*.md' ]
Expand All @@ -9,15 +10,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: |
npm install
npm run all
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
id: filter
with:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/pull-request-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: |
npm install
npm run all
Expand All @@ -20,7 +24,7 @@ jobs:
permissions:
pull-requests: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
id: filter
with:
Expand All @@ -41,7 +45,7 @@ jobs:
permissions:
pull-requests: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
id: filter
with:
Expand All @@ -53,7 +57,7 @@ jobs:
test-without-token:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
id: filter
with:
Expand All @@ -66,7 +70,7 @@ jobs:
test-wd-without-token:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: somewhere
- uses: ./somewhere
Expand All @@ -82,7 +86,7 @@ jobs:
test-local-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: echo "NEW FILE" > local
- run: git add local
- uses: ./
Expand All @@ -102,7 +106,7 @@ jobs:
test-change-type:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: configure GIT user
run: git config user.email "[email protected]" && git config user.name "John Doe"
- name: modify working tree
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v3.0.0
- [Update to Node.js 20 ](https://github.com/dorny/paths-filter/pull/210)
- [Update all dependencies](https://github.com/dorny/paths-filter/pull/215)

## v2.11.1
- [Update @actions/core to v1.10.0 - Fixes warning about deprecated set-output](https://github.com/dorny/paths-filter/pull/167)
- [Document need for pull-requests: read permission](https://github.com/dorny/paths-filter/pull/168)
Expand Down
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ don't allow this because they don't work on a level of individual jobs or steps.

- [sentry.io](https://sentry.io/) - [backend.yml](https://github.com/getsentry/sentry/blob/2ebe01feab863d89aa7564e6d243b6d80c230ddc/.github/workflows/backend.yml#L36)
- [GoogleChrome/web.dev](https://web.dev/) - [lint-workflow.yml](https://github.com/GoogleChrome/web.dev/blob/3a57b721e7df6fc52172f676ca68d16153bda6a3/.github/workflows/lint-workflow.yml#L26)
- [blog post Configuring python linting to be part of CI/CD using GitHub actions](https://dev.to/freshbooks/configuring-python-linting-to-be-part-of-cicd-using-github-actions-1731#what-files-does-it-run-against) - [py_linter.yml](https://github.com/iamtodor/demo-github-actions-python-linter-configuration/blob/main/.github/workflows/py_linter.yml#L31)

## Supported workflows

Expand Down Expand Up @@ -45,7 +46,7 @@ don't allow this because they don't work on a level of individual jobs or steps.
## Example

```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
Expand All @@ -71,6 +72,7 @@ For more scenarios see [examples](#examples) section.

## What's New

- New major release `v3` after update to Node 20 [Breaking change]
- Add `ref` input parameter
- Add `list-files: csv` format
- Configure matrix job to run for each folder with changes using `changes` output
Expand All @@ -82,7 +84,7 @@ For more information, see [CHANGELOG](https://github.com/dorny/paths-filter/blob
## Usage

```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
with:
# Defines filters applied to detected changed files.
# Each filter has a name and a list of rules.
Expand Down Expand Up @@ -174,8 +176,8 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand Down Expand Up @@ -219,7 +221,7 @@ jobs:
frontend: ${{ steps.filter.outputs.frontend }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -234,7 +236,7 @@ jobs:
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- ...
# JOB to build and test frontend code
Expand All @@ -243,7 +245,7 @@ jobs:
if: ${{ needs.changes.outputs.frontend == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- ...
```

Expand All @@ -265,7 +267,7 @@ jobs:
packages: ${{ steps.filter.outputs.changes }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -282,7 +284,7 @@ jobs:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- ...
```

Expand All @@ -306,8 +308,8 @@ jobs:
permissions:
pull-requests: read
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: ... # Configure your filters
Expand All @@ -327,12 +329,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# This may save additional git fetch roundtrip if
# merge-base is found within latest 20 commits
fetch-depth: 20
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
base: develop # Change detection against merge-base with this branch
Expand All @@ -355,8 +357,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
# Use context to get the branch where commits were pushed.
Expand All @@ -383,14 +385,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Some action that modifies files tracked by git (e.g. code linter)
- uses: johndoe/some-action@v1
# Filter to detect which files were modified
# Changes could be, for example, automatically committed
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
base: HEAD
Expand All @@ -405,7 +407,7 @@ jobs:
<summary>Define filter rules in own file</summary>

```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
# Path to file where filters are defined
Expand All @@ -418,7 +420,7 @@ jobs:
<summary>Use YAML anchors to reuse path expression(s) inside another rule</summary>

```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
# &shared is YAML anchor,
Expand All @@ -439,7 +441,7 @@ jobs:
<summary>Consider if file was added, modified or deleted</summary>

```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
# Changed file can be 'added', 'modified', or 'deleted'.
Expand Down Expand Up @@ -467,7 +469,7 @@ jobs:
<summary>Passing list of modified files as command line args in Linux shell</summary>
```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
# Enable listing of files matching each filter.
Expand All @@ -493,7 +495,7 @@ jobs:
<summary>Passing list of modified files as JSON array to another action</summary>
```yaml
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
# Enable listing of files matching each filter.
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 5da0e4c

Please sign in to comment.