Compare commits

...

3 Commits
v41.0.0 ... v41

Author SHA1 Message Date
Tonye Jack
716b1e1304 fix: update characters escaped by safe output (#1815) 2023-12-24 16:32:32 +00:00
renovate[bot]
7aaf10d9ee chore(deps): update dependency eslint-plugin-prettier to v5.1.2 2023-12-24 06:35:07 +00:00
tj-actions[bot]
cc08e170f4 Upgraded to v41 (#1811)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-12-23 11:07:21 -07:00
7 changed files with 97 additions and 43 deletions

View File

@@ -1,5 +1,62 @@
# Changelog
# [41.0.0](https://github.com/tj-actions/changed-files/compare/v40.2.3...v41.0.0) - (2023-12-23)
## <!-- 1 -->🐛 Bug Fixes
- Update safe output regex and the docs ([#1805](https://github.com/tj-actions/changed-files/issues/1805)) ([ff2f6e6](https://github.com/tj-actions/changed-files/commit/ff2f6e6b91913a7be42be1b5917330fe442f2ede)) - (tj-actions[bot])
## <!-- 11 -->⏪ Reverts
- Revert "chore(deps): update actions/download-artifact action to v4" ([#1806](https://github.com/tj-actions/changed-files/issues/1806))
([4f573fe](https://github.com/tj-actions/changed-files/commit/4f573fed06c9abb5da4c72f75c1c320718114ff7)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update README.md ([6e79d6e](https://github.com/tj-actions/changed-files/commit/6e79d6e3dbe48946636c2939c80ff5c84ff7f9fe)) - (Tonye Jack)
- Update README.md ([d13ac19](https://github.com/tj-actions/changed-files/commit/d13ac1942fb3c1d7d32017915bb082cebe8a272a)) - (Tonye Jack)
- Update README.md ([bb89f97](https://github.com/tj-actions/changed-files/commit/bb89f97963be96b39e1a303e64d5b91a1af4c340)) - (Tonye Jack)
- Updated README.md ([#1810](https://github.com/tj-actions/changed-files/issues/1810))
Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com> ([1864078](https://github.com/tj-actions/changed-files/commit/1864078d0afadf68ba489e671ecc09fefe8b70ab)) - (tj-actions[bot])
- Update README.md ([#1808](https://github.com/tj-actions/changed-files/issues/1808))
([47371c5](https://github.com/tj-actions/changed-files/commit/47371c50e97c089212d9eb92ca26c8453224e78e)) - (Tonye Jack)
## <!-- 30 -->📝 Other
- Merge pull request from GHSA-mcph-m25j-8j63
* feat: add `safe_output` input enabled by default
* fix: migrate README to safe uses of interpolation
* fix: README `uses` typo
* fix: README examples to account for newlines
* fix: README examples missing `safe_output`
* fix: remove sanitization of `'`
* fix: also sanitize `|&;` ([0102c07](https://github.com/tj-actions/changed-files/commit/0102c07446a3cad972f4afcbd0ee4dbc4b6d2d1b)) - (Jorge)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([f495a03](https://github.com/tj-actions/changed-files/commit/f495a0321d3fffa62da2573adf70b77d5eb2f57a)) - (renovate[bot])
- **deps:** Update dependency eslint-plugin-prettier to v5.1.1 ([089842a](https://github.com/tj-actions/changed-files/commit/089842a7a899531f61a45ef6ea69c485e1d62dbe)) - (renovate[bot])
- **deps:** Lock file maintenance ([787db06](https://github.com/tj-actions/changed-files/commit/787db0612e783421667a00319cf394b649682c4c)) - (renovate[bot])
- **deps:** Update dependency eslint-plugin-prettier to v5.1.0 ([4ef6b56](https://github.com/tj-actions/changed-files/commit/4ef6b56482141a958bd3efb05520e4df9ecf4147)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.15.0 ([c9ae347](https://github.com/tj-actions/changed-files/commit/c9ae347dbba64d95d83f36a0568e0e25a688dd1f)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v40.2.3 ([#1800](https://github.com/tj-actions/changed-files/issues/1800))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([f9480db](https://github.com/tj-actions/changed-files/commit/f9480db177263c95588c5d9dae7c78f97d39242a)) - (tj-actions[bot])
# [40.2.3](https://github.com/tj-actions/changed-files/compare/v40.2.2...v40.2.3) - (2023-12-18)
## <!-- 16 --> Add

View File

@@ -122,7 +122,7 @@ jobs:
# Example 1
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
# 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
@@ -138,7 +138,7 @@ jobs:
# Example 2
- name: Get all changed markdown files
id: changed-markdown-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
# Avoid using single or double quotes for multiline patterns
files: |
@@ -156,7 +156,7 @@ jobs:
# Example 3
- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
files_yaml: |
doc:
@@ -190,7 +190,7 @@ jobs:
# Example 3
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
files: docs/*.{js,html} # Alternatively using: `docs/**`
files_ignore: docs/static.js
@@ -232,7 +232,7 @@ jobs:
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
- name: List all changed files
env:
@@ -275,7 +275,7 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
- name: List all changed files
@@ -320,7 +320,7 @@ Support this project with a :star:
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
```yaml
- uses: tj-actions/changed-files@v40
- uses: tj-actions/changed-files@v41
id: changed-files
with:
# Github API URL.
@@ -702,7 +702,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
...
```
@@ -715,7 +715,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
@@ -738,7 +738,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@v40
uses: tj-actions/changed-files@v41
with:
separator: ","
...
@@ -755,7 +755,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
- name: List all added files
env:
@@ -778,7 +778,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
- name: Run a step if my-file.txt was modified
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
@@ -799,7 +799,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@v40
uses: tj-actions/changed-files@v41
with:
write_output_files: true
@@ -818,7 +818,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@v40
uses: tj-actions/changed-files@v41
with:
json: true
write_output_files: true
@@ -838,7 +838,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
files: |
my-file.txt
@@ -861,7 +861,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
files: |
my-file.txt
@@ -912,7 +912,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@v40
uses: tj-actions/changed-files@v41
with:
files_from_source_file: test/changed-files-list.txt
...
@@ -929,7 +929,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@v40
uses: tj-actions/changed-files@v41
with:
files_from_source_file: |
test/changed-files-list.txt
@@ -950,7 +950,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different SHA
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
sha: ${{ github.event.pull_request.head.sha }}
...
@@ -967,7 +967,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different base SHA
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
base_sha: ${{ github.event.pull_request.base.sha }}
...
@@ -999,11 +999,11 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
- name: Get changed files in the .github folder
id: changed-files-specific
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: .github/**
@@ -1035,7 +1035,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@v40
uses: tj-actions/changed-files@v41
with:
path: dir1
@@ -1061,13 +1061,13 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with quotepath disabled
id: changed-files-quotepath
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
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@v40
uses: tj-actions/changed-files@v41
with:
files: test/test-è.txt
quotepath: "false"
@@ -1100,7 +1100,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@v40
uses: tj-actions/changed-files@v41
with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
...
@@ -1127,7 +1127,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@v40
uses: tj-actions/changed-files@v41
with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
...
@@ -1153,7 +1153,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with dir_names
id: changed-files-dir-names
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
dir_names: "true"
...
@@ -1170,7 +1170,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with JSON output
id: changed-files-json
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
json: "true"
...
@@ -1187,13 +1187,13 @@ See [inputs](#inputs) for more information.
...
- name: Get changed-files since 2022-08-19
id: changed-files-since
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
since: "2022-08-19"
- name: Get changed-files until 2022-08-20
id: changed-files-until
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v41
with:
until: "2022-08-20"
...

2
dist/index.js generated vendored
View File

@@ -2829,7 +2829,7 @@ const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shou
}
// if safeOutput is true, escape special characters for bash shell
if (safeOutput) {
cleanedValue = cleanedValue.replace(/[^\x20-\x7E]|[:*?"<>|;`$()&!]/g, '\\$&');
cleanedValue = cleanedValue.replace(/[^\x20-\x7E]|[:*?<>|;`$()&!]/g, '\\$&');
}
core.setOutput(key, cleanedValue);
if (writeOutputFiles) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "@tj-actions/changed-files",
"version": "40.2.3",
"version": "41.0.0",
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
"main": "lib/main.js",
"publishConfig": {

View File

@@ -1355,10 +1355,7 @@ export const setOutput = async ({
// if safeOutput is true, escape special characters for bash shell
if (safeOutput) {
cleanedValue = cleanedValue.replace(
/[^\x20-\x7E]|[:*?"<>|;`$()&!]/g,
'\\$&'
)
cleanedValue = cleanedValue.replace(/[^\x20-\x7E]|[:*?<>|;`$()&!]/g, '\\$&')
}
core.setOutput(key, cleanedValue)

View File

@@ -1895,12 +1895,12 @@ eslint-plugin-no-only-tests@^3.0.0:
integrity sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==
eslint-plugin-prettier@^5.0.0, eslint-plugin-prettier@^5.0.0-alpha.2:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.1.tgz#ab7d9823788b557ff7ccdd50a5849d7760cb8bef"
integrity sha512-WQpV3mSmIobb77s4qiCZu3dBrZZ0rj8ckSfBtRrgNK9Wnh2s3eiaxNTWloz1LJ1WtvqZES/PAI7PLvsrGt/CEA==
version "5.1.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.2.tgz#584c94d4bf31329b2d4cbeb10fd600d17d6de742"
integrity sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==
dependencies:
prettier-linter-helpers "^1.0.0"
synckit "^0.8.5"
synckit "^0.8.6"
eslint-rule-documentation@>=1.0.0:
version "1.0.23"
@@ -3890,7 +3890,7 @@ svg-element-attributes@^1.3.1:
resolved "https://registry.yarnpkg.com/svg-element-attributes/-/svg-element-attributes-1.3.1.tgz#0c55afac6284291ab563d0913c062cf78a8c0ddb"
integrity sha512-Bh05dSOnJBf3miNMqpsormfNtfidA/GxQVakhtn0T4DECWKeXQRQUceYjJ+OxYiiLdGe4Jo9iFV8wICFapFeIA==
synckit@^0.8.5:
synckit@^0.8.6:
version "0.8.6"
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.6.tgz#b69b7fbce3917c2673cbdc0d87fb324db4a5b409"
integrity sha512-laHF2savN6sMeHCjLRkheIU4wo3Zg9Ln5YOjOo7sZ5dVQW8yF5pPE5SIw1dsPhq3TRp1jisKRCdPhfs/1WMqDA==