diff --git a/.eslintrc.json b/.eslintrc.json index 5b89d83..fd1c600 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,6 @@ { "plugins": ["jest", "@typescript-eslint"], - "extends": ["plugin:github/es6"], + "extends": ["plugin:github/internal"], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 9, @@ -16,13 +16,10 @@ "@typescript-eslint/no-require-imports": "error", "@typescript-eslint/array-type": "error", "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-ts-ignore": "error", "camelcase": "off", "@typescript-eslint/camelcase": "off", - "@typescript-eslint/class-name-casing": "error", "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], "@typescript-eslint/func-call-spacing": ["error", "never"], - "@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"], "@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "off", @@ -32,7 +29,6 @@ "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-non-null-assertion": "warn", - "@typescript-eslint/no-object-literal-type-assertion": "error", "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-useless-constructor": "error", @@ -40,7 +36,6 @@ "@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-function-type": "warn", "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-interface": "error", "@typescript-eslint/prefer-string-starts-ends-with": "error", "@typescript-eslint/promise-function-async": ["error", { "allowAny": true }], "@typescript-eslint/require-array-sort-compare": "error", diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcfa47e..f3705f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | npm install npm run all @@ -17,7 +17,7 @@ jobs: self-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./ id: filter with: diff --git a/.github/workflows/pull-request-verification.yml b/.github/workflows/pull-request-verification.yml index a773f2f..5ea06ac 100644 --- a/.github/workflows/pull-request-verification.yml +++ b/.github/workflows/pull-request-verification.yml @@ -10,15 +10,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | npm install npm run all test-inline: runs-on: ubuntu-latest + permissions: + pull-requests: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./ id: filter with: @@ -36,8 +38,10 @@ jobs: test-external: runs-on: ubuntu-latest + permissions: + pull-requests: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./ id: filter with: @@ -49,7 +53,7 @@ jobs: test-without-token: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./ id: filter with: @@ -62,7 +66,7 @@ jobs: test-wd-without-token: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: path: somewhere - uses: ./somewhere @@ -78,7 +82,7 @@ jobs: test-local-changes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: echo "NEW FILE" > local - run: git add local - uses: ./ diff --git a/CHANGELOG.md b/CHANGELOG.md index d28d8b7..bd7d0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ ## v3.0.0 - [Breaking: use micromatch instead of picomatch](https://github.com/AurorNZ/paths-filter/pull/1) +## 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) +- [Updating to actions/checkout@v3](https://github.com/dorny/paths-filter/pull/164) + +## v2.11.0 +- [Set list-files input parameter as not required](https://github.com/dorny/paths-filter/pull/157) +- [Update Node.js](https://github.com/dorny/paths-filter/pull/161) +- [Fix incorrect handling of Unicode characters in exec()](https://github.com/dorny/paths-filter/pull/162) +- [Use Octokit pagination](https://github.com/dorny/paths-filter/pull/163) +- [Updates real world links](https://github.com/dorny/paths-filter/pull/160) + ## v2.10.2 - [Fix getLocalRef() returns wrong ref](https://github.com/dorny/paths-filter/pull/91) diff --git a/README.md b/README.md index 98cd06b..6825eb1 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,9 @@ don't allow this because they don't work on a level of individual jobs or steps. **Real world usage examples:** -- [sentry.io](https://sentry.io/) - [backend-test-py3.6.yml](https://github.com/getsentry/sentry/blob/ca0e43dc5602a9ab2e06d3f6397cc48fb5a78541/.github/workflows/backend-test-py3.6.yml#L32) -- [GoogleChrome/web.dev](https://web.dev/) - [lint-and-test-workflow.yml](https://github.com/GoogleChrome/web.dev/blob/e1f0c28964e99ce6a996c1e3fd3ee1985a7a04f6/.github/workflows/lint-and-test-workflow.yml#L33) +- [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 @@ -19,6 +20,7 @@ don't allow this because they don't work on a level of individual jobs or steps. or **[pull_request_target](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target)** event - Changes are detected against the pull request base branch - Uses GitHub REST API to fetch a list of modified files + - Requires [pull-requests: read](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) permission - **Feature branches:** - Workflow triggered by **[push](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)** or any other **[event](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)** @@ -87,6 +89,8 @@ For more information, see [CHANGELOG](https://github.com/dorny/paths-filter/blob # Each filter has a name and a list of rules. # Rule is a glob expression - paths of all changed # files are matched against it. + # Rule can optionally specify if the file + # should be added, modified, or deleted. # For each filter, there will be a corresponding output variable to # indicate if there's a changed file matching any of the rules. # Optionally, there can be a second output variable @@ -171,7 +175,7 @@ jobs: tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dorny/paths-filter@v2 id: filter with: @@ -207,6 +211,9 @@ jobs: # JOB to run change detection changes: runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read # Set job outputs to values from filter step outputs: backend: ${{ steps.filter.outputs.backend }} @@ -228,7 +235,7 @@ jobs: if: ${{ needs.changes.outputs.backend == 'true' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - ... # JOB to build and test frontend code @@ -237,7 +244,7 @@ jobs: if: ${{ needs.changes.outputs.frontend == 'true' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - ... ``` @@ -251,6 +258,9 @@ jobs: # JOB to run change detection changes: runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read outputs: # Expose matched filters as job 'packages' output variable packages: ${{ steps.filter.outputs.changes }} @@ -273,7 +283,7 @@ jobs: package: ${{ fromJSON(needs.changes.outputs.packages) }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - ... ``` @@ -293,8 +303,11 @@ on: jobs: build: runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dorny/paths-filter@v2 id: filter with: @@ -315,7 +328,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # This may save additional git fetch roundtrip if # merge-base is found within latest 20 commits @@ -343,7 +356,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dorny/paths-filter@v2 id: filter with: @@ -371,7 +384,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Some action that modifies files tracked by git (e.g. code linter) - uses: johndoe/some-action@v1 diff --git a/action.yml b/action.yml index 4b1aa72..2839a14 100644 --- a/action.yml +++ b/action.yml @@ -34,7 +34,7 @@ inputs: If needed it uses single or double quotes to wrap filename with unsafe characters. 'escape'- Space delimited list usable as command line argument list in linux shell. Backslash escapes every potentially unsafe character. - required: true + required: false default: none initial-fetch-depth: description: |