Compare commits

...

3 Commits

Author SHA1 Message Date
Tonye Jack
6cb76d07be fix: bug modified_keys and changed_key outputs not set when no changes detected (#2509) 2025-04-03 16:44:43 +00:00
Tonye Jack
b74df86ccb docs: update readme (#2508) 2025-03-31 18:32:49 +00:00
github-actions[bot]
27ae6b33ea Upgraded to v46.0.3 (#2506)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
2025-03-23 11:10:50 +00:00
6 changed files with 82 additions and 66 deletions

View File

@@ -19,7 +19,7 @@ jobs:
- name: Run release-tagger
uses: tj-actions/release-tagger@1a9264b0fd99a1ef92c4fd2f077f292900cc79b6 # v4.0.0
- name: Sync release version.
uses: tj-actions/sync-release-version@2c909a7cf69905388d998101c40edb26d0882ea2 # v13.12
uses: tj-actions/sync-release-version@2a7ef0deb39b3ecce887ee99d2261c6cef989d84 # v13.16
id: sync-release-version
with:
pattern: '${{ github.repository }}@'
@@ -28,7 +28,7 @@ jobs:
paths: |
README.md
- name: Sync release package version.
uses: tj-actions/sync-release-version@2c909a7cf69905388d998101c40edb26d0882ea2 # v13.12
uses: tj-actions/sync-release-version@2a7ef0deb39b3ecce887ee99d2261c6cef989d84 # v13.16
id: sync-release-package-version
with:
pattern: '"version": "'

View File

@@ -1,5 +1,33 @@
# Changelog
# [46.0.3](https://github.com/tj-actions/changed-files/compare/v46.0.2...v46.0.3) - (2025-03-23)
## <!-- 26 -->🔄 Update
- Updated README.md ([#2501](https://github.com/tj-actions/changed-files/issues/2501))
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> ([41e0de5](https://github.com/tj-actions/changed-files/commit/41e0de576a0f2b64d9f06f2773f539109e55a70a)) - (github-actions[bot])
- Updated README.md ([#2499](https://github.com/tj-actions/changed-files/issues/2499))
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> ([9457878](https://github.com/tj-actions/changed-files/commit/945787811a795cd840a1157ac590dd7827a05c8e)) - (github-actions[bot])
## <!-- 3 -->📚 Documentation
- Remove warning ([#2504](https://github.com/tj-actions/changed-files/issues/2504)) ([8132356](https://github.com/tj-actions/changed-files/commit/813235684248c47a3518575ef56906084b59e7e8)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Bump test/demo from `5dfac2e` to `c6bd3b3` ([#2505](https://github.com/tj-actions/changed-files/issues/2505)) ([823fceb](https://github.com/tj-actions/changed-files/commit/823fcebdb31bb35fdf2229d9f769b400309430d0)) - (dependabot[bot])
- Pin github actions ([#2503](https://github.com/tj-actions/changed-files/issues/2503)) ([7a369a7](https://github.com/tj-actions/changed-files/commit/7a369a71758acce79205e5145cb728a08ae607fb)) - (Tonye Jack)
- **deps-dev:** Bump @types/node from 22.13.10 to 22.13.11 ([#2502](https://github.com/tj-actions/changed-files/issues/2502)) ([9468856](https://github.com/tj-actions/changed-files/commit/9468856c2214566e4f7d96d3a018fb3e889a4d6d)) - (dependabot[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v46.0.2 ([#2500](https://github.com/tj-actions/changed-files/issues/2500))
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com> ([401c722](https://github.com/tj-actions/changed-files/commit/401c7227d10aad0ed26ab13735f1b290c3bcc919)) - (github-actions[bot])
# [46.0.2](https://github.com/tj-actions/changed-files/compare/v46.0.1...v46.0.2) - (2025-03-22)
## <!-- 1 -->🐛 Bug Fixes

View File

@@ -122,7 +122,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with:
# since_last_remote_commit: true
@@ -140,7 +140,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get all changed markdown files
id: changed-markdown-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
# Avoid using single or double quotes for multiline patterns
files: |
@@ -161,7 +161,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files_yaml: |
doc:
@@ -196,7 +196,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files: docs/*.{js,html} # Alternatively using: `docs/**`
files_ignore: docs/static.js
@@ -238,7 +238,7 @@ jobs:
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
- name: List all changed files
env:
@@ -281,7 +281,7 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
- name: List all changed files
@@ -328,7 +328,7 @@ Support this project with a :star:
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
```yaml
- uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
- uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
id: changed-files
with:
# Github API URL.
@@ -813,7 +813,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
...
```
@@ -826,7 +826,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
@@ -849,7 +849,7 @@ The format of the version string is as follows:
...
- name: Get all changed files and use a comma separator in the output
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
separator: ","
...
@@ -866,7 +866,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
- name: List all added files
env:
@@ -889,7 +889,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
- name: Run a step if my-file.txt was modified
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
@@ -910,7 +910,7 @@ See [outputs](#outputs) for a list of all available outputs.
- name: Get changed files and write the outputs to a Txt file
id: changed-files-write-output-files-txt
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
write_output_files: true
@@ -929,7 +929,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
json: true
write_output_files: true
@@ -949,7 +949,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files: |
my-file.txt
@@ -972,7 +972,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files: |
my-file.txt
@@ -1023,7 +1023,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files using a source file or list of file(s) to populate to files input.
id: changed-files-specific-source-file
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files_from_source_file: test/changed-files-list.txt
...
@@ -1040,7 +1040,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
id: changed-files-specific-source-file-and-specify-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files_from_source_file: |
test/changed-files-list.txt
@@ -1061,7 +1061,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different SHA
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
sha: ${{ github.event.pull_request.head.sha }}
...
@@ -1078,7 +1078,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different base SHA
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
base_sha: ${{ github.event.pull_request.base.sha }}
...
@@ -1110,7 +1110,7 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
- name: List changed files
env:
@@ -1120,7 +1120,7 @@ jobs:
- name: Get changed files in the .github folder
id: changed-files-specific
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files: .github/**
@@ -1151,7 +1151,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with defaults in dir1
id: changed-files-for-dir1
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
path: dir1
@@ -1176,13 +1176,13 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with quotepath disabled
id: changed-files-quotepath
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
quotepath: "false"
- name: Run changed-files with quotepath disabled for a specified list of file(s)
id: changed-files-quotepath-specific
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
files: test/test-è.txt
quotepath: "false"
@@ -1215,7 +1215,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run
id: changed-files-base-sha-push
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
...
@@ -1242,7 +1242,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run on the main branch
id: changed-files-base-sha-pull-request
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
...
@@ -1268,7 +1268,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with dir_names
id: changed-files-dir-names
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
dir_names: "true"
...
@@ -1285,7 +1285,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with JSON output
id: changed-files-json
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
json: "true"
...
@@ -1302,13 +1302,13 @@ See [inputs](#inputs) for more information.
...
- name: Get changed-files since 2022-08-19
id: changed-files-since
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
since: "2022-08-19"
- name: Get changed-files until 2022-08-20
id: changed-files-until
uses: tj-actions/changed-files@26a38635fc1173cc5820336ce97be6188d0de9f5 # v46
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
with:
until: "2022-08-20"
...
@@ -1326,14 +1326,10 @@ See [inputs](#inputs) for more information.
* [qgis/QGIS: uses tj-actions/changed-files to automate spell checking](https://github.com/qgis/QGIS/blob/a5333497e90ac9de4ca70463d8e0b64c3f294d63/.github/workflows/code_layout.yml#L147)
* [coder/code-server: uses tj-actions/changed-files to automate detecting changes and run steps based on the outcome](https://github.com/coder/code-server/blob/c32a31d802f679846876b8ad9aacff6cf7b5361d/.github/workflows/build.yaml#L48)
* [tldr-pages/tldr: uses tj-actions/changed-files to automate detecting spelling errors](https://github.com/tldr-pages/tldr/blob/c1b714c55cb0048037b79a681a10d7f3ddb0164c/.github/workflows/codespell.yml#L18-L26)
* [nodejs/docker-node: uses tj-actions/changed-files to generate matrix jobs based on changes detected](https://github.com/nodejs/docker-node/blob/3c4fa6daf06a4786d202f2f610351837806a0380/.github/workflows/build-test.yml#L29)
* [refined-github: uses tj-actions/changed-files to automate test URL validation in added/edited files](https://github.com/refined-github/refined-github/blob/b754bfe58904da8a599d7876fdaaf18302785629/.github/workflows/features.yml#L35)
* [aws-doc-sdk-examples: uses tj-actions/changed-files to automate testing](https://github.com/awsdocs/aws-doc-sdk-examples/blob/2393723ef6b0cad9502f4852f5c72f7be58ca89d/.github/workflows/javascript.yml#L22)
* [nhost: uses tj-actions/changed-files to automate testing based on changes detected](https://github.com/nhost/nhost/blob/71a8ce444618a8ac4d660518172fba4883c4014b/.github/workflows/ci.yaml#L44-L48)

24
dist/index.js generated vendored
View File

@@ -97,20 +97,16 @@ const processChangedFiles = async ({ filePatterns, allDiffFiles, inputs, yamlFil
core.info('All Done!');
core.endGroup();
}
if (modifiedKeys.length > 0) {
await (0, utils_1.setArrayOutput)({
key: 'modified_keys',
inputs,
value: modifiedKeys
});
}
if (changedKeys.length > 0) {
await (0, utils_1.setArrayOutput)({
key: 'changed_keys',
inputs,
value: changedKeys
});
}
await (0, utils_1.setArrayOutput)({
key: 'modified_keys',
inputs,
value: modifiedKeys
});
await (0, utils_1.setArrayOutput)({
key: 'changed_keys',
inputs,
value: changedKeys
});
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
core.startGroup('changed-files-all');

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -89,21 +89,17 @@ export const processChangedFiles = async ({
core.endGroup()
}
if (modifiedKeys.length > 0) {
await setArrayOutput({
key: 'modified_keys',
inputs,
value: modifiedKeys
})
}
await setArrayOutput({
key: 'modified_keys',
inputs,
value: modifiedKeys
})
if (changedKeys.length > 0) {
await setArrayOutput({
key: 'changed_keys',
inputs,
value: changedKeys
})
}
await setArrayOutput({
key: 'changed_keys',
inputs,
value: changedKeys
})
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {