Skip to content

Commit 60967b8

Browse files
Merge pull request #195 from step-security/auto-cherry-pick
chore: Cherry-picked changes from upstream
2 parents 720a641 + a08b0f0 commit 60967b8

File tree

10 files changed

+57
-40
lines changed

10 files changed

+57
-40
lines changed

.github/workflows/auto_cherry_pick.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ permissions:
3333
jobs:
3434
cherry-pick:
3535
if: github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
36-
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@upstream-Changes-CherryPick
36+
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
3737
with:
3838
original-owner: "tj-actions"
3939
repo-name: "changed-files"

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ jobs:
4949
fetch-depth: 0
5050
repository: ${{ github.event.pull_request.head.repo.full_name }}
5151

52-
- name: Use Node.js 20.x
52+
- name: Use Node.js 24.x
5353
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
5454
with:
5555
cache: 'yarn'
56-
node-version: '20.x'
56+
node-version: '24.x'
5757

5858
- name: Create coverage directory and clover.xml
5959
run: |

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
24

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Effortlessly track all changed files and directories relative to a target branch
5454
* Between the last remote branch commit and the current HEAD.
5555
* Restricts change detection to a subset of files and directories:
5656
* Provides boolean output indicating changes in specific files.
57-
* Uses [Glob pattern](https://codepen.io/mrmlnc/pen/OXQjMe) matching.
57+
* Uses [Glob pattern](https://en.wikipedia.org/wiki/Glob_\(programming\)) matching.
5858
* Supports Globstar.
5959
* Supports brace expansion.
6060
* Supports negation.
@@ -736,6 +736,7 @@ To access more examples, navigate to the [Examples](#examples-) section.
736736
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` |
737737
| <a name="output_all_old_new_renamed_files"></a>[all\_old\_new\_renamed\_files](#output_all_old_new_renamed_files) | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
738738
| <a name="output_all_old_new_renamed_files_count"></a>[all\_old\_new\_renamed\_files\_count](#output_all_old_new_renamed_files_count) | string | Returns the number of `all_old_new_renamed_files` |
739+
| <a name="output_any_added"></a>[any\_added](#output_any_added) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been added. |
739740
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have changed. This <br>defaults to `true` when no <br>patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
740741
| <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been deleted. <br>This defaults to `true` when <br>no patterns are specified. (D) |
741742
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been modified. <br>This defaults to `true` when <br>no patterns are specified. i.e. <br>*includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |

action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ outputs:
250250
description: "Returns only files that are Added (A)."
251251
added_files_count:
252252
description: "Returns the number of `added_files`"
253+
any_added:
254+
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been added."
253255
copied_files:
254256
description: "Returns only files that are Copied (C)."
255257
copied_files_count:
@@ -324,7 +326,7 @@ outputs:
324326
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and renamed (ACMR)"
325327

326328
runs:
327-
using: 'node20'
329+
using: 'node24'
328330
main: 'dist/index.js'
329331

330332
branding:

dist/index.js

Lines changed: 38 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/__snapshots__/inputs.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`getInputs should correctly parse boolean inputs 1`] = `
44
{

src/changedFilesOutput.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
5252
writeOutputFiles: inputs.writeOutputFiles,
5353
outputDir: inputs.outputDir
5454
})
55+
await setOutput({
56+
key: getOutputKey('any_added', outputPrefix),
57+
value: addedFiles.paths.length > 0,
58+
writeOutputFiles: inputs.writeOutputFiles,
59+
outputDir: inputs.outputDir,
60+
json: inputs.json
61+
})
5562

5663
const copiedFiles = await getChangeTypeFiles({
5764
inputs,

test/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This is a test file...
1+
This is a test file

0 commit comments

Comments
 (0)