Skip to content

Commit

Permalink
chore: rename git fetch arguments (#1259)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
jackton1 and actions-user committed Jun 14, 2023
1 parent 174a2a6 commit b9ea510
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/commitSha.ts
Expand Up @@ -85,7 +85,7 @@ export const getSHAForPushEvent = async (
workingDirectory: string,
isShallow: boolean,
hasSubmodule: boolean,
gitExtraArgs: string[],
gitFetchExtraArgs: string[],
isTag: boolean
): Promise<DiffResult> => {
let targetBranch = env.GITHUB_REF_NAME
Expand All @@ -102,7 +102,7 @@ export const getSHAForPushEvent = async (
await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
Expand All @@ -114,7 +114,7 @@ export const getSHAForPushEvent = async (
await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
Expand All @@ -128,7 +128,7 @@ export const getSHAForPushEvent = async (
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
Expand Down Expand Up @@ -263,7 +263,7 @@ export const getSHAForPullRequestEvent = async (
workingDirectory: string,
isShallow: boolean,
hasSubmodule: boolean,
gitExtraArgs: string[]
gitFetchExtraArgs: string[]
): Promise<DiffResult> => {
let targetBranch = env.GITHUB_EVENT_PULL_REQUEST_BASE_REF
const currentBranch = env.GITHUB_EVENT_PULL_REQUEST_HEAD_REF
Expand All @@ -277,7 +277,7 @@ export const getSHAForPullRequestEvent = async (
let prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
'origin',
Expand All @@ -289,7 +289,7 @@ export const getSHAForPullRequestEvent = async (
prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
Expand All @@ -310,7 +310,7 @@ export const getSHAForPullRequestEvent = async (
await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
Expand All @@ -323,7 +323,7 @@ export const getSHAForPullRequestEvent = async (
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
Expand Down Expand Up @@ -415,7 +415,7 @@ export const getSHAForPullRequestEvent = async (
await gitFetch({
cwd: workingDirectory,
args: [
...gitExtraArgs,
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
Expand Down
8 changes: 4 additions & 4 deletions src/main.ts
Expand Up @@ -59,7 +59,7 @@ export async function run(): Promise<void> {
)
const isShallow = await isRepoShallow({cwd: workingDirectory})
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
let gitExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
let submodulePaths: string[] = []

Expand All @@ -68,7 +68,7 @@ export async function run(): Promise<void> {
}

if (isTag) {
gitExtraArgs = ['--prune', '--no-recurse-submodules']
gitFetchExtraArgs = ['--prune', '--no-recurse-submodules']
}

let diffResult: DiffResult
Expand All @@ -81,7 +81,7 @@ export async function run(): Promise<void> {
workingDirectory,
isShallow,
hasSubmodule,
gitExtraArgs,
gitFetchExtraArgs,
isTag
)
} else {
Expand All @@ -94,7 +94,7 @@ export async function run(): Promise<void> {
workingDirectory,
isShallow,
hasSubmodule,
gitExtraArgs
gitFetchExtraArgs
)
}

Expand Down

0 comments on commit b9ea510

Please sign in to comment.