Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f7b5c900b | ||
|
|
161a189eb5 | ||
|
|
a48618a94b | ||
|
|
2bdfc0c60d | ||
|
|
cf4fe8759a | ||
|
|
58c7ce2add | ||
|
|
61316fda76 | ||
|
|
5d38ef5289 | ||
|
|
51330c5719 | ||
|
|
7b92155d7a | ||
|
|
3127174fab | ||
|
|
cfdaf8f14e | ||
|
|
043929ee8f | ||
|
|
96fd19710a |
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@@ -508,6 +508,16 @@ jobs:
|
||||
echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with dir name
|
||||
id: changed-files-dir-name
|
||||
uses: ./
|
||||
with:
|
||||
files: .github/workflows
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files-dir-name.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with write_output_files
|
||||
id: changed-files-write-output-files
|
||||
uses: ./
|
||||
|
||||
59
HISTORY.md
59
HISTORY.md
@@ -1,5 +1,64 @@
|
||||
# Changelog
|
||||
|
||||
# [36.0.9](https://github.com/tj-actions/changed-files/compare/v36.0.8...v36.0.9) - (2023-05-29)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Matching all nested files with a directory name ([#1197](https://github.com/tj-actions/changed-files/issues/1197)) ([cf4fe87](https://github.com/tj-actions/changed-files/commit/cf4fe8759a45edd76ed6215da3529d2dbd2a3c68)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1196](https://github.com/tj-actions/changed-files/issues/1196))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([58c7ce2](https://github.com/tj-actions/changed-files/commit/58c7ce2addd872691e0da689c1fa281c07713275)) - (tj-actions[bot])
|
||||
- Update README.md ([61316fd](https://github.com/tj-actions/changed-files/commit/61316fda7680cc63f418e60ecc690b89be1da81f)) - (Tonye Jack)
|
||||
- Update README.md ([#1195](https://github.com/tj-actions/changed-files/issues/1195))
|
||||
|
||||
([5d38ef5](https://github.com/tj-actions/changed-files/commit/5d38ef52895b6ff6402354d6848ec6fedbf0d2ca)) - (Tonye Jack)
|
||||
- Update README.md ([51330c5](https://github.com/tj-actions/changed-files/commit/51330c5719e5ccb3eba7e629ea5d44be35d04b00)) - (Tonye Jack)
|
||||
- Update README.md ([7b92155](https://github.com/tj-actions/changed-files/commit/7b92155d7a2bb44c09d58bd53e4cc54e6ce4811a)) - (Tonye Jack)
|
||||
- Update README.md ([3127174](https://github.com/tj-actions/changed-files/commit/3127174fab678ec0c8a22b5482efa6c350cec573)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.8 ([#1192](https://github.com/tj-actions/changed-files/issues/1192))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([cfdaf8f](https://github.com/tj-actions/changed-files/commit/cfdaf8f14eabcd0bbf60d1fdde9009892b275ddc)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.8](https://github.com/tj-actions/changed-files/compare/v36.0.7...v36.0.8) - (2023-05-29)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for running on release event ([#1191](https://github.com/tj-actions/changed-files/issues/1191)) ([043929e](https://github.com/tj-actions/changed-files/commit/043929ee8fffa1dd1d619782a5a338cf39e76e23)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.7 ([#1190](https://github.com/tj-actions/changed-files/issues/1190))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([96fd197](https://github.com/tj-actions/changed-files/commit/96fd19710a49b0e910f7363e8af37dd6b182636a)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.7](https://github.com/tj-actions/changed-files/compare/v36.0.6...v36.0.7) - (2023-05-29)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug running changed files with limited history ([#1188](https://github.com/tj-actions/changed-files/issues/1188)) ([449a845](https://github.com/tj-actions/changed-files/commit/449a845ff28da516ea1752afd195d2f7f642c6f4)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update README.md ([777b2b4](https://github.com/tj-actions/changed-files/commit/777b2b437a82c8afbb474f57812fd790c7509391)) - (Tonye Jack)
|
||||
- Update README.md ([2fafe0a](https://github.com/tj-actions/changed-files/commit/2fafe0a7349fddf5ea3a02484419a4831979d79b)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Lock file maintenance ([#1189](https://github.com/tj-actions/changed-files/issues/1189)) ([4e2535f](https://github.com/tj-actions/changed-files/commit/4e2535f2b330e70ff7055f7de4272653cfdbd555)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/eslint-changed-files action to v19 ([#1185](https://github.com/tj-actions/changed-files/issues/1185)) ([bc88d8b](https://github.com/tj-actions/changed-files/commit/bc88d8bc954005f987c5c73e133f2cb4927ddf3e)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.6 ([#1184](https://github.com/tj-actions/changed-files/issues/1184))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([fd2b77d](https://github.com/tj-actions/changed-files/commit/fd2b77dd749ff644f3fe50e1f7341902e0064744)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.6](https://github.com/tj-actions/changed-files/compare/v36.0.5...v36.0.6) - (2023-05-26)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
19
README.md
19
README.md
@@ -59,6 +59,7 @@ Retrieve all changed files and directories relative to a target branch, preceedi
|
||||
* Restrict change detection to a subset of files and directories:
|
||||
* Boolean output indicating that certain files have been changed.
|
||||
* Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
|
||||
* Globstar.
|
||||
* Brace expansion.
|
||||
|
||||
## Usage
|
||||
@@ -67,7 +68,6 @@ Retrieve all changed files and directories relative to a target branch, preceedi
|
||||
>
|
||||
> * **IMPORTANT:** For `push` events when configuring [`actions/checkout`](https://github.com/actions/checkout#usage) the `fetch-depth` should be set to either `fetch-depth: 0` **OR** `fetch-depth: 2` depending on your use case.
|
||||
> * For monorepos where pulling all the branch history might not be desired, you can omit [`actions/checkout`](https://github.com/actions/checkout#usage) - `fetch-depth` for `pull_request` events.
|
||||
> * For files located in a sub-directory ensure that the pattern specified contains `**/` (globstar) to match any preceding directories or explicitly pass the full path relative to the project root. See: [Pattern Gotcha](https://github.com/tj-actions/glob#pattern-gotcha).
|
||||
> * All multiline inputs should not use double or single quotes since the value is already a string seperated by a newline character. See [Examples](#examples) for more information.
|
||||
> * Ensure that `persist-credentials` is set to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage) if `fetch-depth` isn't set to `0`.
|
||||
|
||||
@@ -82,10 +82,10 @@ on:
|
||||
branches:
|
||||
- main
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
# Event `push`: Compare the preceeding commit -> to the current commit of the main branch.
|
||||
# Event `pull_request`: Compare the last commit of main -> to the current commit of a Pull Request branch.
|
||||
# -------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -125,19 +125,19 @@ jobs:
|
||||
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
|
||||
|
||||
# Example 3
|
||||
- name: Get all changed *.js file(s) or any file in the static folder excluding the docs folder
|
||||
- name: Get all changed .js file(s) or any file in the static folder excluding the docs folder
|
||||
id: changed-files-excluded
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files: |
|
||||
**/*.js
|
||||
**.js
|
||||
static
|
||||
files_ignore: docs
|
||||
|
||||
- name: Run step if any *.js file(s) or any file in the static folder change
|
||||
- name: Run step if any .js file(s) or any file in the static folder change
|
||||
if: steps.changed-files-excluded.outputs.any_changed == 'true'
|
||||
run: |
|
||||
echo "One or more *.js file(s) or any file in the static folder but not in the doc folder has changed."
|
||||
echo "One or more .js file(s) or any file in the static folder but not in the doc folder has changed."
|
||||
echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}"
|
||||
```
|
||||
|
||||
@@ -731,6 +731,10 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
* [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)
|
||||
|
||||
And many more...
|
||||
|
||||
## Known Limitation
|
||||
@@ -767,7 +771,6 @@ With the switch from using grep's Extended regex to match files to the natively
|
||||
|
||||
This package was created with [cookiecutter-action](https://github.com/tj-actions/cookiecutter-action).
|
||||
|
||||
* [tj-actions/glob](https://github.com/tj-actions/glob)
|
||||
* [tj-actions/auto-doc](https://github.com/tj-actions/auto-doc)
|
||||
* [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files)
|
||||
* [tj-actions/demo](https://github.com/tj-actions/demo)
|
||||
|
||||
61
dist/index.js
generated
vendored
61
dist/index.js
generated
vendored
@@ -213,7 +213,8 @@ const getSHAForPushEvent = (inputs, env, workingDirectory, isShallow, hasSubmodu
|
||||
if (isShallow) {
|
||||
core.info('Repository is shallow, fetching more history...');
|
||||
if (isTag) {
|
||||
const sourceBranch = env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '');
|
||||
const sourceBranch = env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '') ||
|
||||
env.GITHUB_EVENT_RELEASE_TARGET_COMMITISH;
|
||||
yield (0, utils_1.gitFetch)({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
@@ -403,6 +404,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
});
|
||||
}
|
||||
}
|
||||
core.info('Completed fetching more history.');
|
||||
}
|
||||
const currentSha = yield getCurrentSHA({ inputs, workingDirectory });
|
||||
let previousSha = inputs.baseSha;
|
||||
@@ -445,12 +447,12 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
}
|
||||
}
|
||||
else {
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
|
||||
previousSha = yield (0, utils_1.gitLsRemote)({
|
||||
cwd: workingDirectory,
|
||||
args: [targetBranch]
|
||||
});
|
||||
if (!previousSha) {
|
||||
previousSha = yield (0, utils_1.gitLsRemote)({
|
||||
cwd: workingDirectory,
|
||||
args: [targetBranch]
|
||||
});
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
|
||||
}
|
||||
if (isShallow) {
|
||||
if (yield (0, utils_1.canDiffCommits)({
|
||||
@@ -568,7 +570,7 @@ exports.getEnv = void 0;
|
||||
const fs_1 = __nccwpck_require__(7147);
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
||||
const eventPath = process.env.GITHUB_EVENT_PATH;
|
||||
let eventJson = {};
|
||||
if (eventPath) {
|
||||
@@ -581,9 +583,10 @@ const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: ((_d = (_c = eventJson.pull_request) === null || _c === void 0 ? void 0 : _c.base) === null || _d === void 0 ? void 0 : _d.ref) || '',
|
||||
GITHUB_EVENT_BEFORE: eventJson.before || '',
|
||||
GITHUB_EVENT_BASE_REF: eventJson.base_ref || '',
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: ((_e = eventJson.head_repo) === null || _e === void 0 ? void 0 : _e.fork) || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: ((_f = eventJson.pull_request) === null || _f === void 0 ? void 0 : _f.number) || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ((_h = (_g = eventJson.pull_request) === null || _g === void 0 ? void 0 : _g.base) === null || _h === void 0 ? void 0 : _h.sha) || '',
|
||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH: ((_e = eventJson.release) === null || _e === void 0 ? void 0 : _e.target_commitish) || '',
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: ((_f = eventJson.head_repo) === null || _f === void 0 ? void 0 : _f.fork) || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: ((_g = eventJson.pull_request) === null || _g === void 0 ? void 0 : _g.number) || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ((_j = (_h = eventJson.pull_request) === null || _h === void 0 ? void 0 : _h.base) === null || _j === void 0 ? void 0 : _j.sha) || '',
|
||||
GITHUB_EVENT_FORCED: eventJson.forced || '',
|
||||
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
|
||||
GITHUB_REF: process.env.GITHUB_REF || '',
|
||||
@@ -978,8 +981,8 @@ function run() {
|
||||
});
|
||||
core.debug(`All other changed files: ${allOtherChangedFiles}`);
|
||||
const otherChangedFiles = allOtherChangedFiles
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(filePath => !allChangedFiles.split(inputs.filesSeparator).includes(filePath));
|
||||
.split(inputs.separator)
|
||||
.filter(filePath => !allChangedFiles.split(inputs.separator).includes(filePath));
|
||||
const onlyChanged = otherChangedFiles.length === 0 && allChangedFiles.length > 0;
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: 'only_changed',
|
||||
@@ -988,7 +991,7 @@ function run() {
|
||||
});
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: 'other_changed_files',
|
||||
value: otherChangedFiles.join(inputs.filesSeparator),
|
||||
value: otherChangedFiles.join(inputs.separator),
|
||||
inputs
|
||||
});
|
||||
const allModifiedFiles = yield (0, changedFiles_1.getDiffFiles)({
|
||||
@@ -1020,8 +1023,8 @@ function run() {
|
||||
submodulePaths
|
||||
});
|
||||
const otherModifiedFiles = allOtherModifiedFiles
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(filePath => !allModifiedFiles.split(inputs.filesSeparator).includes(filePath));
|
||||
.split(inputs.separator)
|
||||
.filter(filePath => !allModifiedFiles.split(inputs.separator).includes(filePath));
|
||||
const onlyModified = otherModifiedFiles.length === 0 && allModifiedFiles.length > 0;
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: 'only_modified',
|
||||
@@ -1030,7 +1033,7 @@ function run() {
|
||||
});
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: 'other_modified_files',
|
||||
value: otherModifiedFiles.join(inputs.filesSeparator),
|
||||
value: otherModifiedFiles.join(inputs.separator),
|
||||
inputs
|
||||
});
|
||||
const deletedFiles = yield (0, changedFiles_1.getDiffFiles)({
|
||||
@@ -1062,8 +1065,8 @@ function run() {
|
||||
submodulePaths
|
||||
});
|
||||
const otherDeletedFiles = allOtherDeletedFiles
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(filePath => !deletedFiles.split(inputs.filesSeparator).includes(filePath));
|
||||
.split(inputs.separator)
|
||||
.filter(filePath => !deletedFiles.split(inputs.separator).includes(filePath));
|
||||
const onlyDeleted = otherDeletedFiles.length === 0 && deletedFiles.length > 0;
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: 'only_deleted',
|
||||
@@ -1072,7 +1075,7 @@ function run() {
|
||||
});
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: 'other_deleted_files',
|
||||
value: otherDeletedFiles.join(inputs.filesSeparator),
|
||||
value: otherDeletedFiles.join(inputs.separator),
|
||||
inputs
|
||||
});
|
||||
if (inputs.includeAllOldNewRenamedFiles) {
|
||||
@@ -1658,7 +1661,25 @@ const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void
|
||||
filePatterns = filePatterns.replace(/\r/g, '\n');
|
||||
}
|
||||
core.debug(`file patterns: ${filePatterns}`);
|
||||
return filePatterns.trim().split('\n').filter(Boolean);
|
||||
return filePatterns
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(Boolean)
|
||||
.map(pattern => {
|
||||
if (pattern.endsWith('/')) {
|
||||
return `${pattern}**`;
|
||||
}
|
||||
else {
|
||||
const pathParts = pattern.split('/');
|
||||
const lastPart = pathParts[pathParts.length - 1];
|
||||
if (!lastPart.includes('.')) {
|
||||
return `${pattern}/**`;
|
||||
}
|
||||
else {
|
||||
return pattern;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
exports.getFilePatterns = getFilePatterns;
|
||||
const setOutput = ({ key, value, inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -41,8 +41,8 @@
|
||||
"@types/micromatch": "^4.0.2",
|
||||
"@types/node": "20.2.1",
|
||||
"@types/uuid": "9.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.59.7",
|
||||
"@typescript-eslint/parser": "5.59.7",
|
||||
"@typescript-eslint/eslint-plugin": "5.59.8",
|
||||
"@typescript-eslint/parser": "5.59.8",
|
||||
"@vercel/ncc": "0.36.1",
|
||||
"eslint": "8.41.0",
|
||||
"eslint-plugin-github": "4.7.0",
|
||||
|
||||
@@ -83,7 +83,9 @@ export const getSHAForPushEvent = async (
|
||||
core.info('Repository is shallow, fetching more history...')
|
||||
|
||||
if (isTag) {
|
||||
const sourceBranch = env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '')
|
||||
const sourceBranch =
|
||||
env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '') ||
|
||||
env.GITHUB_EVENT_RELEASE_TARGET_COMMITISH
|
||||
await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
@@ -310,6 +312,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
})
|
||||
}
|
||||
}
|
||||
core.info('Completed fetching more history.')
|
||||
}
|
||||
|
||||
const currentSha = await getCurrentSHA({inputs, workingDirectory})
|
||||
@@ -367,13 +370,13 @@ export const getSHAForPullRequestEvent = async (
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||
}
|
||||
} else {
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||
previousSha = await gitLsRemote({
|
||||
cwd: workingDirectory,
|
||||
args: [targetBranch]
|
||||
})
|
||||
|
||||
if (!previousSha) {
|
||||
previousSha = await gitLsRemote({
|
||||
cwd: workingDirectory,
|
||||
args: [targetBranch]
|
||||
})
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||
}
|
||||
|
||||
if (isShallow) {
|
||||
|
||||
@@ -8,6 +8,7 @@ export type Env = {
|
||||
GITHUB_REF_NAME: string
|
||||
GITHUB_REF: string
|
||||
GITHUB_EVENT_BASE_REF: string
|
||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH: string
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: string
|
||||
GITHUB_WORKSPACE: string
|
||||
GITHUB_EVENT_FORCED: string
|
||||
@@ -27,6 +28,9 @@ type GithubEvent = {
|
||||
}
|
||||
number: string
|
||||
}
|
||||
release?: {
|
||||
target_commitish: string
|
||||
}
|
||||
before?: string
|
||||
base_ref?: string
|
||||
head_repo?: {
|
||||
@@ -49,6 +53,8 @@ export const getEnv = async (): Promise<Env> => {
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: eventJson.pull_request?.base?.ref || '',
|
||||
GITHUB_EVENT_BEFORE: eventJson.before || '',
|
||||
GITHUB_EVENT_BASE_REF: eventJson.base_ref || '',
|
||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH:
|
||||
eventJson.release?.target_commitish || '',
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head_repo?.fork || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '',
|
||||
|
||||
20
src/main.ts
20
src/main.ts
@@ -265,10 +265,9 @@ export async function run(): Promise<void> {
|
||||
core.debug(`All other changed files: ${allOtherChangedFiles}`)
|
||||
|
||||
const otherChangedFiles = allOtherChangedFiles
|
||||
.split(inputs.filesSeparator)
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath =>
|
||||
!allChangedFiles.split(inputs.filesSeparator).includes(filePath)
|
||||
filePath => !allChangedFiles.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyChanged =
|
||||
@@ -282,7 +281,7 @@ export async function run(): Promise<void> {
|
||||
|
||||
await setOutput({
|
||||
key: 'other_changed_files',
|
||||
value: otherChangedFiles.join(inputs.filesSeparator),
|
||||
value: otherChangedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
@@ -318,10 +317,9 @@ export async function run(): Promise<void> {
|
||||
})
|
||||
|
||||
const otherModifiedFiles = allOtherModifiedFiles
|
||||
.split(inputs.filesSeparator)
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath =>
|
||||
!allModifiedFiles.split(inputs.filesSeparator).includes(filePath)
|
||||
filePath => !allModifiedFiles.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyModified =
|
||||
@@ -335,7 +333,7 @@ export async function run(): Promise<void> {
|
||||
|
||||
await setOutput({
|
||||
key: 'other_modified_files',
|
||||
value: otherModifiedFiles.join(inputs.filesSeparator),
|
||||
value: otherModifiedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
@@ -371,9 +369,9 @@ export async function run(): Promise<void> {
|
||||
})
|
||||
|
||||
const otherDeletedFiles = allOtherDeletedFiles
|
||||
.split(inputs.filesSeparator)
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath => !deletedFiles.split(inputs.filesSeparator).includes(filePath)
|
||||
filePath => !deletedFiles.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyDeleted = otherDeletedFiles.length === 0 && deletedFiles.length > 0
|
||||
@@ -386,7 +384,7 @@ export async function run(): Promise<void> {
|
||||
|
||||
await setOutput({
|
||||
key: 'other_deleted_files',
|
||||
value: otherDeletedFiles.join(inputs.filesSeparator),
|
||||
value: otherDeletedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
|
||||
18
src/utils.ts
18
src/utils.ts
@@ -757,7 +757,23 @@ export const getFilePatterns = async ({
|
||||
|
||||
core.debug(`file patterns: ${filePatterns}`)
|
||||
|
||||
return filePatterns.trim().split('\n').filter(Boolean)
|
||||
return filePatterns
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(Boolean)
|
||||
.map(pattern => {
|
||||
if (pattern.endsWith('/')) {
|
||||
return `${pattern}**`
|
||||
} else {
|
||||
const pathParts = pattern.split('/')
|
||||
const lastPart = pathParts[pathParts.length - 1]
|
||||
if (!lastPart.includes('.')) {
|
||||
return `${pattern}/**`
|
||||
} else {
|
||||
return pattern
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const setOutput = async ({
|
||||
|
||||
88
yarn.lock
88
yarn.lock
@@ -805,7 +805,23 @@
|
||||
dependencies:
|
||||
"@types/yargs-parser" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@5.59.7", "@typescript-eslint/eslint-plugin@^5.1.0":
|
||||
"@typescript-eslint/eslint-plugin@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz#1e7a3e5318ece22251dfbc5c9c6feeb4793cc509"
|
||||
integrity sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==
|
||||
dependencies:
|
||||
"@eslint-community/regexpp" "^4.4.0"
|
||||
"@typescript-eslint/scope-manager" "5.59.8"
|
||||
"@typescript-eslint/type-utils" "5.59.8"
|
||||
"@typescript-eslint/utils" "5.59.8"
|
||||
debug "^4.3.4"
|
||||
grapheme-splitter "^1.0.4"
|
||||
ignore "^5.2.0"
|
||||
natural-compare-lite "^1.4.0"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^5.1.0":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.7.tgz#e470af414f05ecfdc05a23e9ce6ec8f91db56fe2"
|
||||
integrity sha512-BL+jYxUFIbuYwy+4fF86k5vdT9lT0CNJ6HtwrIvGh0PhH8s0yy5rjaKH2fDCrz5ITHy07WCzVGNvAmjJh4IJFA==
|
||||
@@ -821,7 +837,17 @@
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@5.59.7", "@typescript-eslint/parser@^5.1.0":
|
||||
"@typescript-eslint/parser@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.8.tgz#60cbb00671d86cf746044ab797900b1448188567"
|
||||
integrity sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.59.8"
|
||||
"@typescript-eslint/types" "5.59.8"
|
||||
"@typescript-eslint/typescript-estree" "5.59.8"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/parser@^5.1.0":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.7.tgz#02682554d7c1028b89aa44a48bf598db33048caa"
|
||||
integrity sha512-VhpsIEuq/8i5SF+mPg9jSdIwgMBBp0z9XqjiEay+81PYLJuroN+ET1hM5IhkiYMJd9MkTz8iJLt7aaGAgzWUbQ==
|
||||
@@ -839,6 +865,14 @@
|
||||
"@typescript-eslint/types" "5.59.7"
|
||||
"@typescript-eslint/visitor-keys" "5.59.7"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz#ff4ad4fec6433647b817c4a7d4b4165d18ea2fa8"
|
||||
integrity sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.59.8"
|
||||
"@typescript-eslint/visitor-keys" "5.59.8"
|
||||
|
||||
"@typescript-eslint/type-utils@5.59.7":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.7.tgz#89c97291371b59eb18a68039857c829776f1426d"
|
||||
@@ -849,11 +883,26 @@
|
||||
debug "^4.3.4"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/type-utils@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz#aa6c029a9d7706d26bbd25eb4666398781df6ea2"
|
||||
integrity sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==
|
||||
dependencies:
|
||||
"@typescript-eslint/typescript-estree" "5.59.8"
|
||||
"@typescript-eslint/utils" "5.59.8"
|
||||
debug "^4.3.4"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@5.59.7":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.7.tgz#6f4857203fceee91d0034ccc30512d2939000742"
|
||||
integrity sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==
|
||||
|
||||
"@typescript-eslint/types@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.8.tgz#212e54414733618f5d0fd50b2da2717f630aebf8"
|
||||
integrity sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.59.7":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz#b887acbd4b58e654829c94860dbff4ac55c5cff8"
|
||||
@@ -867,6 +916,19 @@
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz#801a7b1766481629481b3b0878148bd7a1f345d7"
|
||||
integrity sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.59.8"
|
||||
"@typescript-eslint/visitor-keys" "5.59.8"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.59.7", "@typescript-eslint/utils@^5.10.0":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.7.tgz#7adf068b136deae54abd9a66ba5a8780d2d0f898"
|
||||
@@ -881,6 +943,20 @@
|
||||
eslint-scope "^5.1.1"
|
||||
semver "^7.3.7"
|
||||
|
||||
"@typescript-eslint/utils@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.8.tgz#34d129f35a2134c67fdaf024941e8f96050dca2b"
|
||||
integrity sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils" "^4.2.0"
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@types/semver" "^7.3.12"
|
||||
"@typescript-eslint/scope-manager" "5.59.8"
|
||||
"@typescript-eslint/types" "5.59.8"
|
||||
"@typescript-eslint/typescript-estree" "5.59.8"
|
||||
eslint-scope "^5.1.1"
|
||||
semver "^7.3.7"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.59.7":
|
||||
version "5.59.7"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz#09c36eaf268086b4fbb5eb9dc5199391b6485fc5"
|
||||
@@ -889,6 +965,14 @@
|
||||
"@typescript-eslint/types" "5.59.7"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.59.8":
|
||||
version "5.59.8"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz#aa6a7ef862add919401470c09e1609392ef3cc40"
|
||||
integrity sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.59.8"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@vercel/ncc@0.36.1":
|
||||
version "0.36.1"
|
||||
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.36.1.tgz#d4c01fdbbe909d128d1bf11c7f8b5431654c5b95"
|
||||
|
||||
Reference in New Issue
Block a user