Compare commits
9 Commits
main
...
takost/tes
Author | SHA1 | Date |
---|---|---|
Tatyana Kostromskaya | 2b8f79e013 | |
Tatyana Kostromskaya | d651e32721 | |
Tatyana Kostromskaya | 8f0d2fbedc | |
Tatyana Kostromskaya | 418530e26c | |
Tatyana Kostromskaya | 0cf6e008d0 | |
Tatyana Kostromskaya | 9a43814785 | |
Tatyana Kostromskaya | 317b5f36ae | |
Tatyana Kostromskaya | efb66ddacf | |
Tatyana Kostromskaya | 3e9f24a519 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -169,8 +169,9 @@ describe('git-auth-helper tests', () => {
|
|||
|
||||
// Mock fs.promises.readFile
|
||||
const realReadFile = fs.promises.readFile
|
||||
jest.spyOn(fs.promises, 'readFile').mockImplementation(
|
||||
async (file: any, options: any): Promise<Buffer> => {
|
||||
jest
|
||||
.spyOn(fs.promises, 'readFile')
|
||||
.mockImplementation(async (file: any, options: any): Promise<Buffer> => {
|
||||
const userKnownHostsPath = path.join(
|
||||
os.homedir(),
|
||||
'.ssh',
|
||||
|
@ -181,8 +182,7 @@ describe('git-auth-helper tests', () => {
|
|||
}
|
||||
|
||||
return await realReadFile(file, options)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
// Act
|
||||
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
||||
|
|
|
@ -7,11 +7,11 @@ let git: IGitCommandManager
|
|||
|
||||
describe('ref-helper tests', () => {
|
||||
beforeEach(() => {
|
||||
git = ({} as unknown) as IGitCommandManager
|
||||
git = {} as unknown as IGitCommandManager
|
||||
})
|
||||
|
||||
it('getCheckoutInfo requires git', async () => {
|
||||
const git = (null as unknown) as IGitCommandManager
|
||||
const git = null as unknown as IGitCommandManager
|
||||
try {
|
||||
await refHelper.getCheckoutInfo(git, 'refs/heads/my/branch', commit)
|
||||
throw new Error('Should not reach here')
|
||||
|
|
|
@ -68,7 +68,7 @@ describe('retry-helper tests', () => {
|
|||
|
||||
it('all attempts fail succeeds', async () => {
|
||||
let attempts = 0
|
||||
let error: Error = (null as unknown) as Error
|
||||
let error: Error = null as unknown as Error
|
||||
try {
|
||||
await retryHelper.execute(() => {
|
||||
throw new Error(`some error ${++attempts}`)
|
||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
|
@ -28,28 +28,28 @@
|
|||
},
|
||||
"homepage": "https://github.com/actions/checkout#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.0.1",
|
||||
"@actions/github": "^5.0.0",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "file:actions-github-6.0.2.tgz",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^1.1.2",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"uuid": "^3.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/node": "^20.5.3",
|
||||
"@types/jest": "^29.5.5",
|
||||
"@types/node": "^20.8.2",
|
||||
"@types/uuid": "^3.4.6",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-github": "^4.3.2",
|
||||
"eslint-plugin-jest": "^25.7.0",
|
||||
"jest": "^27.3.0",
|
||||
"jest-circus": "^27.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||
"@typescript-eslint/parser": "^6.7.4",
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"eslint": "^8.50.0",
|
||||
"eslint-plugin-github": "^4.10.1",
|
||||
"eslint-plugin-jest": "^27.4.2",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"prettier": "^1.19.1",
|
||||
"ts-jest": "^27.0.7",
|
||||
"typescript": "^4.4.4"
|
||||
"prettier": "^3.0.3",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
|
@ -18,8 +18,9 @@ export function directoryExistsSync(path: string, required?: boolean): boolean {
|
|||
}
|
||||
|
||||
throw new Error(
|
||||
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
|
||||
?.message ?? error}`
|
||||
`Encountered an error when checking whether path '${path}' exists: ${
|
||||
(error as any)?.message ?? error
|
||||
}`
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -45,8 +46,9 @@ export function existsSync(path: string): boolean {
|
|||
}
|
||||
|
||||
throw new Error(
|
||||
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
|
||||
?.message ?? error}`
|
||||
`Encountered an error when checking whether path '${path}' exists: ${
|
||||
(error as any)?.message ?? error
|
||||
}`
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -67,8 +69,9 @@ export function fileExistsSync(path: string): boolean {
|
|||
}
|
||||
|
||||
throw new Error(
|
||||
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
|
||||
?.message ?? error}`
|
||||
`Encountered an error when checking whether path '${path}' exists: ${
|
||||
(error as any)?.message ?? error
|
||||
}`
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class GitAuthHelper {
|
|||
gitSourceSettings: IGitSourceSettings | undefined
|
||||
) {
|
||||
this.git = gitCommandManager
|
||||
this.settings = gitSourceSettings || (({} as unknown) as IGitSourceSettings)
|
||||
this.settings = gitSourceSettings || ({} as unknown as IGitSourceSettings)
|
||||
|
||||
// Token auth header
|
||||
const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl)
|
||||
|
|
|
@ -6,7 +6,7 @@ import * as workflowContextHelper from './workflow-context-helper'
|
|||
import {IGitSourceSettings} from './git-source-settings'
|
||||
|
||||
export async function getInputs(): Promise<IGitSourceSettings> {
|
||||
const result = ({} as unknown) as IGitSourceSettings
|
||||
const result = {} as unknown as IGitSourceSettings
|
||||
|
||||
// GitHub workspace
|
||||
let githubWorkspacePath = process.env['GITHUB_WORKSPACE']
|
||||
|
@ -149,7 +149,8 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
|||
(core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE'
|
||||
|
||||
// Workflow organization ID
|
||||
result.workflowOrganizationId = await workflowContextHelper.getOrganizationId()
|
||||
result.workflowOrganizationId =
|
||||
await workflowContextHelper.getOrganizationId()
|
||||
|
||||
// Set safe.directory in git global config.
|
||||
result.setSafeDirectory =
|
||||
|
|
|
@ -23,7 +23,7 @@ export async function getCheckoutInfo(
|
|||
throw new Error('Args ref and commit cannot both be empty')
|
||||
}
|
||||
|
||||
const result = ({} as unknown) as ICheckoutInfo
|
||||
const result = {} as unknown as ICheckoutInfo
|
||||
const upperRef = (ref || '').toUpperCase()
|
||||
|
||||
// SHA only
|
||||
|
|
|
@ -23,8 +23,9 @@ export async function getOrganizationId(): Promise<number | undefined> {
|
|||
return id as number
|
||||
} catch (err) {
|
||||
core.debug(
|
||||
`Unable to load organization ID from GITHUB_EVENT_PATH: ${(err as any)
|
||||
.message || err}`
|
||||
`Unable to load organization ID from GITHUB_EVENT_PATH: ${
|
||||
(err as any).message || err
|
||||
}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue