Revert change

This commit is contained in:
Tonye Jack 2023-06-22 20:05:25 -06:00
parent efe3e32d02
commit 71c896b78e
5 changed files with 7 additions and 18 deletions

10
dist/index.js generated vendored
View File

@ -708,7 +708,7 @@ const getSHAForPushEvent = (inputs, env, workingDirectory, isShallow, hasSubmodu
let targetBranch = env.GITHUB_REF_NAME;
const currentBranch = targetBranch;
let initialCommit = false;
if (isShallow && env.CHANGED_FILES_HISTORY_FETCHED !== 'true') {
if (isShallow) {
core.info('Repository is shallow, fetching more history...');
if (isTag) {
const sourceBranch = env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '') ||
@ -852,7 +852,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
if (inputs.sinceLastRemoteCommit) {
targetBranch = currentBranch;
}
if (isShallow && env.CHANGED_FILES_HISTORY_FETCHED !== 'true') {
if (isShallow) {
core.info('Repository is shallow, fetching more history...');
let prFetchExitCode = yield (0, utils_1.gitFetch)({
cwd: workingDirectory,
@ -1112,8 +1112,7 @@ const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE || '',
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || '',
GITHUB_REPOSITORY_OWNER: process.env.GITHUB_REPOSITORY_OWNER || '',
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || '',
CHANGED_FILES_HISTORY_FETCHED: process.env.CHANGED_FILES_HISTORY_FETCHED || ''
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || ''
};
});
exports.getEnv = getEnv;
@ -1383,9 +1382,6 @@ const getChangedFilesFromLocalGit = ({ inputs, env, workingDirectory }) => __awa
return;
}
core.info(`Retrieving changes between ${diffResult.previousSha} (${diffResult.targetBranch}) → ${diffResult.currentSha} (${diffResult.currentBranch})`);
if (isShallow) {
core.exportVariable('CHANGED_FILES_HISTORY_FETCHED', 'true');
}
const allDiffFiles = yield (0, changedFiles_1.getAllDiffFiles)({
workingDirectory,
hasSubmodule,

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -92,7 +92,7 @@ export const getSHAForPushEvent = async (
const currentBranch = targetBranch
let initialCommit = false
if (isShallow && env.CHANGED_FILES_HISTORY_FETCHED !== 'true') {
if (isShallow) {
core.info('Repository is shallow, fetching more history...')
if (isTag) {
@ -271,7 +271,7 @@ export const getSHAForPullRequestEvent = async (
targetBranch = currentBranch
}
if (isShallow && env.CHANGED_FILES_HISTORY_FETCHED !== 'true') {
if (isShallow) {
core.info('Repository is shallow, fetching more history...')
let prFetchExitCode = await gitFetch({

View File

@ -19,7 +19,6 @@ export type Env = {
GITHUB_EVENT_PULL_REQUEST_BASE_REF: string
GITHUB_REPOSITORY_OWNER: string
GITHUB_REPOSITORY: string
CHANGED_FILES_HISTORY_FETCHED: string
}
type GithubEvent = {
@ -76,8 +75,6 @@ export const getEnv = async (): Promise<Env> => {
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE || '',
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || '',
GITHUB_REPOSITORY_OWNER: process.env.GITHUB_REPOSITORY_OWNER || '',
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || '',
CHANGED_FILES_HISTORY_FETCHED:
process.env.CHANGED_FILES_HISTORY_FETCHED || ''
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || ''
}
}

View File

@ -109,10 +109,6 @@ const getChangedFilesFromLocalGit = async ({
`Retrieving changes between ${diffResult.previousSha} (${diffResult.targetBranch}) → ${diffResult.currentSha} (${diffResult.currentBranch})`
)
if (isShallow) {
core.exportVariable('CHANGED_FILES_HISTORY_FETCHED', 'true')
}
const allDiffFiles = await getAllDiffFiles({
workingDirectory,
hasSubmodule,