3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-03-05 21:06:25 +00:00

chore(deps): lock file maintenance (#1224)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
renovate[bot] 2023-06-04 21:46:30 -06:00 committed by GitHub
parent 763a7bfbb5
commit 7c72320404
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 13 deletions

14
dist/index.js generated vendored
View file

@ -409,7 +409,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
} }
core.info('Completed fetching more history.'); core.info('Completed fetching more history.');
} }
const currentSha = yield getCurrentSHA({ inputs, workingDirectory }); let currentSha = yield getCurrentSHA({ inputs, workingDirectory });
let previousSha = inputs.baseSha; let previousSha = inputs.baseSha;
let diff = '...'; let diff = '...';
if (previousSha && currentSha && currentBranch && targetBranch) { if (previousSha && currentSha && currentBranch && targetBranch) {
@ -485,6 +485,9 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA; previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
} }
} }
if (previousSha === currentSha) {
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA;
}
if (!(yield (0, utils_1.canDiffCommits)({ if (!(yield (0, utils_1.canDiffCommits)({
cwd: workingDirectory, cwd: workingDirectory,
sha1: previousSha, sha1: previousSha,
@ -563,7 +566,7 @@ exports.getEnv = void 0;
const fs_1 = __nccwpck_require__(7147); const fs_1 = __nccwpck_require__(7147);
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const getEnv = () => __awaiter(void 0, void 0, void 0, function* () { const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
var _a, _b, _c, _d, _e, _f, _g, _h, _j; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
const eventPath = process.env.GITHUB_EVENT_PATH; const eventPath = process.env.GITHUB_EVENT_PATH;
let eventJson = {}; let eventJson = {};
if (eventPath) { if (eventPath) {
@ -580,6 +583,7 @@ const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
GITHUB_EVENT_HEAD_REPO_FORK: ((_f = eventJson.head_repo) === null || _f === void 0 ? void 0 : _f.fork) || '', 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_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_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_PULL_REQUEST_HEAD_SHA: ((_l = (_k = eventJson.pull_request) === null || _k === void 0 ? void 0 : _k.head) === null || _l === void 0 ? void 0 : _l.sha) || '',
GITHUB_EVENT_FORCED: eventJson.forced || '', GITHUB_EVENT_FORCED: eventJson.forced || '',
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '', GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
GITHUB_REF: process.env.GITHUB_REF || '', GITHUB_REF: process.env.GITHUB_REF || '',
@ -1386,7 +1390,7 @@ const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
return stdout return stdout
.trim() .trim()
.split('\n') .split('\n')
.map(line => normalizePath(line.split(' ')[1])); .map((line) => normalizePath(line.split(' ')[1]));
}); });
exports.getSubmodulePath = getSubmodulePath; exports.getSubmodulePath = getSubmodulePath;
const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff }) => __awaiter(void 0, void 0, void 0, function* () { const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff }) => __awaiter(void 0, void 0, void 0, function* () {
@ -1435,7 +1439,7 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
.trim() .trim()
.split('\n') .split('\n')
.filter(Boolean) .filter(Boolean)
.map(line => { .map((line) => {
core.debug(`Renamed file: ${line}`); core.debug(`Renamed file: ${line}`);
const [, oldPath, newPath] = line.split('\t'); const [, oldPath, newPath] = line.split('\t');
if (isSubmodule) { if (isSubmodule) {
@ -1471,7 +1475,7 @@ const gitDiff = ({ cwd, sha1, sha2, diff, diffFilter, filePatterns = [], isSubmo
const files = stdout const files = stdout
.split('\n') .split('\n')
.filter(Boolean) .filter(Boolean)
.map(p => { .map((p) => {
if (isSubmodule) { if (isSubmodule) {
return normalizePath(path.join(parentDir, p)); return normalizePath(path.join(parentDir, p));
} }

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -321,7 +321,7 @@ export const getSHAForPullRequestEvent = async (
core.info('Completed fetching more history.') core.info('Completed fetching more history.')
} }
const currentSha = await getCurrentSHA({inputs, workingDirectory}) let currentSha = await getCurrentSHA({inputs, workingDirectory})
let previousSha = inputs.baseSha let previousSha = inputs.baseSha
let diff = '...' let diff = '...'
@ -425,6 +425,10 @@ export const getSHAForPullRequestEvent = async (
} }
} }
if (previousSha === currentSha && env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA) {
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
}
if ( if (
!(await canDiffCommits({ !(await canDiffCommits({
cwd: workingDirectory, cwd: workingDirectory,

View file

@ -14,6 +14,7 @@ export type Env = {
GITHUB_EVENT_FORCED: string GITHUB_EVENT_FORCED: string
GITHUB_EVENT_PULL_REQUEST_NUMBER: string GITHUB_EVENT_PULL_REQUEST_NUMBER: string
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: string GITHUB_EVENT_PULL_REQUEST_BASE_SHA: string
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: string
} }
type GithubEvent = { type GithubEvent = {
@ -21,6 +22,7 @@ type GithubEvent = {
pull_request?: { pull_request?: {
head: { head: {
ref: string ref: string
sha: string
} }
base: { base: {
ref: string ref: string
@ -58,6 +60,7 @@ export const getEnv = async (): Promise<Env> => {
GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head_repo?.fork || '', GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head_repo?.fork || '',
GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '', GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '',
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '', GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '',
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: eventJson.pull_request?.head?.sha || '',
GITHUB_EVENT_FORCED: eventJson.forced || '', GITHUB_EVENT_FORCED: eventJson.forced || '',
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '', GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
GITHUB_REF: process.env.GITHUB_REF || '', GITHUB_REF: process.env.GITHUB_REF || '',

View file

@ -288,7 +288,7 @@ export const getSubmodulePath = async ({
return stdout return stdout
.trim() .trim()
.split('\n') .split('\n')
.map(line => normalizePath(line.split(' ')[1])) .map((line: string) => normalizePath(line.split(' ')[1]))
} }
export const gitSubmoduleDiffSHA = async ({ export const gitSubmoduleDiffSHA = async ({
@ -389,7 +389,7 @@ export const gitRenamedFiles = async ({
.trim() .trim()
.split('\n') .split('\n')
.filter(Boolean) .filter(Boolean)
.map(line => { .map((line: string) => {
core.debug(`Renamed file: ${line}`) core.debug(`Renamed file: ${line}`)
const [, oldPath, newPath] = line.split('\t') const [, oldPath, newPath] = line.split('\t')
if (isSubmodule) { if (isSubmodule) {
@ -459,7 +459,7 @@ export const gitDiff = async ({
const files = stdout const files = stdout
.split('\n') .split('\n')
.filter(Boolean) .filter(Boolean)
.map(p => { .map((p: string) => {
if (isSubmodule) { if (isSubmodule) {
return normalizePath(path.join(parentDir, p)) return normalizePath(path.join(parentDir, p))
} }

View file

@ -1171,9 +1171,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
caniuse-lite@^1.0.30001489: caniuse-lite@^1.0.30001489:
version "1.0.30001492" version "1.0.30001494"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001492.tgz#4a06861788a52b4c81fd3344573b68cc87fe062b" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001494.tgz#3e56e04a48da7a79eae994559eb1ec02aaac862f"
integrity sha512-2efF8SAZwgAX1FJr87KWhvuJxnGJKOnctQa8xLOskAXNXq8oiuqgl6u1kk3fFpsp3GgvzlRjiK1sl63hNtFADw== integrity sha512-sY2B5Qyl46ZzfYDegrl8GBCzdawSLT4ThM9b9F+aDYUrAG2zCOyMbd2Tq34mS1g4ZKBfjRlzOohQMxx28x6wJg==
chalk@^2.0.0: chalk@^2.0.0:
version "2.4.2" version "2.4.2"