Compare commits

..

21 Commits

Author SHA1 Message Date
Tonye Jack
9ecc6e7fe2 fix: bug with retrieving the base sha when since last commit is enabled (#1213)
Co-authored-by: GitHub Action <action@github.com>
2023-06-01 11:18:54 -06:00
tj-actions[bot]
72cf8893fc Upgraded to v36.0.13 (#1212)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
2023-06-01 11:02:57 -06:00
tj-actions[bot]
28d6f2964c Upgraded to v36.0.12 (#1210)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-01 16:53:31 +00:00
Tonye Jack
8c9ee56d01 fix: error fetching history (#1211)
Co-authored-by: GitHub Action <action@github.com>
2023-06-01 10:34:16 -06:00
Tonye Jack
5978e5a2df fix: bug retrieving diff when persist credentials is false (#1209)
Co-authored-by: GitHub Action <action@github.com>
2023-06-01 10:03:09 -06:00
tj-actions[bot]
ab45871481 Upgraded to v36.0.11 (#1208)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-05-31 21:44:30 +00:00
Tonye Jack
17c3e9e98f chore: update test to include pull request head sha checkout (#1205) 2023-05-31 21:26:08 +00:00
renovate[bot]
c9dcbc3147 chore(deps): update dependency @types/jest to v29.5.2 (#1207)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-31 17:13:16 +00:00
tj-actions[bot]
aa54931d1d Upgraded to v36.0.10 (#1202)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-05-30 21:50:01 +00:00
Tonye Jack
3f7b5c900b fix: bug with diff output (#1201)
Co-authored-by: GitHub Action <action@github.com>
2023-05-30 15:27:56 -06:00
Tonye Jack
161a189eb5 Update README.md 2023-05-30 15:22:07 -06:00
renovate[bot]
a48618a94b chore(deps): update typescript-eslint monorepo to v5.59.8 (#1199)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 19:13:02 +00:00
tj-actions[bot]
2bdfc0c60d Upgraded to v36.0.9 (#1198)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-05-29 16:27:49 +00:00
Tonye Jack
cf4fe8759a fix: matching all nested files with a directory name (#1197)
Co-authored-by: GitHub Action <action@github.com>
2023-05-29 16:12:36 +00:00
tj-actions[bot]
58c7ce2add Updated README.md (#1196)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-05-29 09:41:26 -06:00
Tonye Jack
61316fda76 Update README.md 2023-05-29 09:21:30 -06:00
Tonye Jack
5d38ef5289 Update README.md (#1195) 2023-05-29 09:20:14 -06:00
Tonye Jack
51330c5719 Update README.md 2023-05-29 09:19:05 -06:00
Tonye Jack
7b92155d7a Update README.md 2023-05-29 09:15:00 -06:00
Tonye Jack
3127174fab Update README.md 2023-05-28 20:26:25 -06:00
tj-actions[bot]
cfdaf8f14e Upgraded to v36.0.8 (#1192)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-05-29 02:13:51 +00:00
10 changed files with 6210 additions and 5947 deletions

View File

@@ -316,6 +316,66 @@ jobs:
shell:
bash
test-pull-request-head-ref:
name: Test changed-files with pull request head ref
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'push'
steps:
- name: Checkout to branch
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: build-assets
- name: Run changed-files
id: changed-files
uses: ./
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files.outputs) }}'
shell:
bash
test-pull-request-without-persist-credentials:
name: Test changed-files with pull request without persist credentials
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'push'
strategy:
fail-fast: false
max-parallel: 4
matrix:
fetch-depth: [1, 2, 0]
steps:
- name: Checkout to branch
uses: actions/checkout@v3
with:
fetch-depth: ${{ matrix.fetch-depth }}
persist-credentials: false
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: build-assets
- name: Run changed-files
id: changed-files
uses: ./
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files.outputs) }}'
shell:
bash
test-non-existent-base-sha:
name: Test changed-files non existent base sha
runs-on: ubuntu-latest
@@ -508,6 +568,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: ./

11794
HISTORY.md

File diff suppressed because it is too large Load Diff

View File

@@ -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)

81
dist/index.js generated vendored
View File

@@ -356,7 +356,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
}
if (isShallow) {
core.info('Repository is shallow, fetching more history...');
const prFetchExitCode = yield (0, utils_1.gitFetch)({
let prFetchExitCode = yield (0, utils_1.gitFetch)({
cwd: workingDirectory,
args: [
...gitExtraArgs,
@@ -367,7 +367,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
]
});
if (prFetchExitCode !== 0) {
yield (0, utils_1.gitFetch)({
prFetchExitCode = yield (0, utils_1.gitFetch)({
cwd: workingDirectory,
args: [
...gitExtraArgs,
@@ -379,6 +379,9 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
]
});
}
if (prFetchExitCode !== 0) {
throw new Error('Failed to fetch pull request branch. Please ensure "persist-credentials" is set to "true" when checking out the repository. See: https://github.com/actions/checkout#usage');
}
if (!inputs.sinceLastRemoteCommit) {
core.debug('Fetching target branch...');
yield (0, utils_1.gitFetch)({
@@ -404,6 +407,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
});
}
}
core.info('Completed fetching more history.');
}
const currentSha = yield getCurrentSHA({ inputs, workingDirectory });
let previousSha = inputs.baseSha;
@@ -432,26 +436,19 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
if (inputs.sinceLastRemoteCommit) {
previousSha = env.GITHUB_EVENT_BEFORE;
if (!previousSha) {
previousSha = yield (0, utils_1.gitLsRemote)({
cwd: workingDirectory,
args: [currentBranch]
});
previousSha = yield (0, utils_1.getParentSha)({ cwd: workingDirectory });
}
if ((yield (0, utils_1.verifyCommitSha)({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0) {
if (!previousSha) {
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
}
}
else {
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
cwd: workingDirectory,
branch: 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)({
@@ -980,8 +977,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',
@@ -990,7 +987,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)({
@@ -1022,8 +1019,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',
@@ -1032,7 +1029,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)({
@@ -1064,8 +1061,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',
@@ -1074,7 +1071,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) {
@@ -1168,7 +1165,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setOutput = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.gitLsRemote = exports.getHeadSha = exports.gitLog = exports.gitDiff = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = void 0;
exports.setOutput = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.getHeadSha = exports.gitLog = exports.gitDiff = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = void 0;
/*global AsyncIterableIterator*/
const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
@@ -1519,18 +1516,14 @@ const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
return stdout.trim();
});
exports.getHeadSha = getHeadSha;
const gitLsRemote = ({ cwd, args }) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout } = yield exec.getExecOutput('git', ['ls-remote', 'origin', ...args], {
const getRemoteBranchHeadSha = ({ cwd, branch }) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
cwd,
silent: process.env.RUNNER_DEBUG !== '1'
});
const output = stdout.trim().split('\t');
if (output.length === 0) {
throw new Error('No output returned from git ls-remote');
}
return output[0];
return stdout.trim();
});
exports.gitLsRemote = gitLsRemote;
exports.getRemoteBranchHeadSha = getRemoteBranchHeadSha;
const getParentSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-list', '-n', '1', 'HEAD^'], {
cwd,
@@ -1660,7 +1653,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

File diff suppressed because one or more lines are too long

View File

@@ -37,12 +37,12 @@
"micromatch": "^4.0.5"
},
"devDependencies": {
"@types/jest": "29.5.1",
"@types/jest": "29.5.2",
"@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",

View File

@@ -7,10 +7,10 @@ import {
getHeadSha,
getParentSha,
getPreviousGitTag,
getRemoteBranchHeadSha,
gitFetch,
gitFetchSubmodules,
gitLog,
gitLsRemote,
verifyCommitSha
} from './utils'
@@ -261,7 +261,7 @@ export const getSHAForPullRequestEvent = async (
if (isShallow) {
core.info('Repository is shallow, fetching more history...')
const prFetchExitCode = await gitFetch({
let prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
@@ -273,7 +273,7 @@ export const getSHAForPullRequestEvent = async (
})
if (prFetchExitCode !== 0) {
await gitFetch({
prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
@@ -286,6 +286,12 @@ export const getSHAForPullRequestEvent = async (
})
}
if (prFetchExitCode !== 0) {
throw new Error(
'Failed to fetch pull request branch. Please ensure "persist-credentials" is set to "true" when checking out the repository. See: https://github.com/actions/checkout#usage'
)
}
if (!inputs.sinceLastRemoteCommit) {
core.debug('Fetching target branch...')
await gitFetch({
@@ -312,6 +318,7 @@ export const getSHAForPullRequestEvent = async (
})
}
}
core.info('Completed fetching more history.')
}
const currentSha = await getCurrentSHA({inputs, workingDirectory})
@@ -353,29 +360,20 @@ export const getSHAForPullRequestEvent = async (
previousSha = env.GITHUB_EVENT_BEFORE
if (!previousSha) {
previousSha = await gitLsRemote({
cwd: workingDirectory,
args: [currentBranch]
})
previousSha = await getParentSha({cwd: workingDirectory})
}
if (
(await verifyCommitSha({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0
) {
if (!previousSha) {
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
}
} else {
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
branch: targetBranch
})
if (!previousSha) {
previousSha = await gitLsRemote({
cwd: workingDirectory,
args: [targetBranch]
})
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
}
if (isShallow) {

View File

@@ -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
})

View File

@@ -501,28 +501,23 @@ export const getHeadSha = async ({cwd}: {cwd: string}): Promise<string> => {
return stdout.trim()
}
export const gitLsRemote = async ({
export const getRemoteBranchHeadSha = async ({
cwd,
args
branch
}: {
cwd: string
args: string[]
branch: string
}): Promise<string> => {
const {stdout} = await exec.getExecOutput(
'git',
['ls-remote', 'origin', ...args],
['rev-parse', `origin/${branch}`],
{
cwd,
silent: process.env.RUNNER_DEBUG !== '1'
}
)
const output = stdout.trim().split('\t')
if (output.length === 0) {
throw new Error('No output returned from git ls-remote')
}
return output[0]
return stdout.trim()
}
export const getParentSha = async ({cwd}: {cwd: string}): Promise<string> => {
@@ -757,7 +752,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 ({

View File

@@ -738,10 +738,10 @@
dependencies:
"@types/istanbul-lib-report" "*"
"@types/jest@29.5.1":
version "29.5.1"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.1.tgz#83c818aa9a87da27d6da85d3378e5a34d2f31a47"
integrity sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==
"@types/jest@29.5.2":
version "29.5.2"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.2.tgz#86b4afc86e3a8f3005b297ed8a72494f89e6395b"
integrity sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"
@@ -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"