Compare commits

...

9 Commits

Author SHA1 Message Date
Tatyana Kostromskaya
2b8f79e013 . 2023-10-05 16:06:04 +02:00
Tatyana Kostromskaya
d651e32721 . 2023-10-05 15:26:14 +02:00
Tatyana Kostromskaya
8f0d2fbedc . 2023-10-05 15:23:37 +02:00
Tatyana Kostromskaya
418530e26c . 2023-10-05 13:16:46 +02:00
Tatyana Kostromskaya
0cf6e008d0 . 2023-10-05 13:12:34 +02:00
Tatyana Kostromskaya
9a43814785 . 2023-10-05 13:10:00 +02:00
Tatyana Kostromskaya
317b5f36ae . 2023-10-05 13:05:27 +02:00
Tatyana Kostromskaya
efb66ddacf . 2023-10-05 13:00:17 +02:00
Tatyana Kostromskaya
3e9f24a519 . 2023-10-05 12:32:54 +02:00
43 changed files with 32406 additions and 13411 deletions

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.

BIN
.licenses/npm/@octokit/tsconfig.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@octokit/types-9.3.2.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/qs.dep.yml generated

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -169,8 +169,9 @@ describe('git-auth-helper tests', () => {
// Mock fs.promises.readFile // Mock fs.promises.readFile
const realReadFile = fs.promises.readFile const realReadFile = fs.promises.readFile
jest.spyOn(fs.promises, 'readFile').mockImplementation( jest
async (file: any, options: any): Promise<Buffer> => { .spyOn(fs.promises, 'readFile')
.mockImplementation(async (file: any, options: any): Promise<Buffer> => {
const userKnownHostsPath = path.join( const userKnownHostsPath = path.join(
os.homedir(), os.homedir(),
'.ssh', '.ssh',
@ -181,8 +182,7 @@ describe('git-auth-helper tests', () => {
} }
return await realReadFile(file, options) return await realReadFile(file, options)
} })
)
// Act // Act
const authHelper = gitAuthHelper.createAuthHelper(git, settings) const authHelper = gitAuthHelper.createAuthHelper(git, settings)

View File

@ -7,11 +7,11 @@ let git: IGitCommandManager
describe('ref-helper tests', () => { describe('ref-helper tests', () => {
beforeEach(() => { beforeEach(() => {
git = ({} as unknown) as IGitCommandManager git = {} as unknown as IGitCommandManager
}) })
it('getCheckoutInfo requires git', async () => { it('getCheckoutInfo requires git', async () => {
const git = (null as unknown) as IGitCommandManager const git = null as unknown as IGitCommandManager
try { try {
await refHelper.getCheckoutInfo(git, 'refs/heads/my/branch', commit) await refHelper.getCheckoutInfo(git, 'refs/heads/my/branch', commit)
throw new Error('Should not reach here') throw new Error('Should not reach here')

View File

@ -68,7 +68,7 @@ describe('retry-helper tests', () => {
it('all attempts fail succeeds', async () => { it('all attempts fail succeeds', async () => {
let attempts = 0 let attempts = 0
let error: Error = (null as unknown) as Error let error: Error = null as unknown as Error
try { try {
await retryHelper.execute(() => { await retryHelper.execute(() => {
throw new Error(`some error ${++attempts}`) throw new Error(`some error ${++attempts}`)

BIN
actions-github-6.0.2.tgz Normal file

Binary file not shown.

Binary file not shown.

30927
dist/index.js vendored

File diff suppressed because one or more lines are too long

14811
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,28 +28,28 @@
}, },
"homepage": "https://github.com/actions/checkout#readme", "homepage": "https://github.com/actions/checkout#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.0", "@actions/core": "^1.10.1",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.1.1",
"@actions/github": "^5.0.0", "@actions/github": "file:actions-github-6.0.2.tgz",
"@actions/io": "^1.1.3", "@actions/io": "^1.1.3",
"@actions/tool-cache": "^1.1.2", "@actions/tool-cache": "^2.0.1",
"uuid": "^3.3.3" "uuid": "^3.3.3"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.2", "@types/jest": "^29.5.5",
"@types/node": "^20.5.3", "@types/node": "^20.8.2",
"@types/uuid": "^3.4.6", "@types/uuid": "^3.4.6",
"@typescript-eslint/eslint-plugin": "^5.45.0", "@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^5.45.0", "@typescript-eslint/parser": "^6.7.4",
"@vercel/ncc": "^0.36.1", "@vercel/ncc": "^0.38.0",
"eslint": "^7.32.0", "eslint": "^8.50.0",
"eslint-plugin-github": "^4.3.2", "eslint-plugin-github": "^4.10.1",
"eslint-plugin-jest": "^25.7.0", "eslint-plugin-jest": "^27.4.2",
"jest": "^27.3.0", "jest": "^29.7.0",
"jest-circus": "^27.3.0", "jest-circus": "^29.7.0",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"prettier": "^1.19.1", "prettier": "^3.0.3",
"ts-jest": "^27.0.7", "ts-jest": "^29.1.1",
"typescript": "^4.4.4" "typescript": "^5.2.2"
} }
} }

View File

@ -18,8 +18,9 @@ export function directoryExistsSync(path: string, required?: boolean): boolean {
} }
throw new Error( throw new Error(
`Encountered an error when checking whether path '${path}' exists: ${(error as any) `Encountered an error when checking whether path '${path}' exists: ${
?.message ?? error}` (error as any)?.message ?? error
}`
) )
} }
@ -45,8 +46,9 @@ export function existsSync(path: string): boolean {
} }
throw new Error( throw new Error(
`Encountered an error when checking whether path '${path}' exists: ${(error as any) `Encountered an error when checking whether path '${path}' exists: ${
?.message ?? error}` (error as any)?.message ?? error
}`
) )
} }
@ -67,8 +69,9 @@ export function fileExistsSync(path: string): boolean {
} }
throw new Error( throw new Error(
`Encountered an error when checking whether path '${path}' exists: ${(error as any) `Encountered an error when checking whether path '${path}' exists: ${
?.message ?? error}` (error as any)?.message ?? error
}`
) )
} }

View File

@ -49,7 +49,7 @@ class GitAuthHelper {
gitSourceSettings: IGitSourceSettings | undefined gitSourceSettings: IGitSourceSettings | undefined
) { ) {
this.git = gitCommandManager this.git = gitCommandManager
this.settings = gitSourceSettings || (({} as unknown) as IGitSourceSettings) this.settings = gitSourceSettings || ({} as unknown as IGitSourceSettings)
// Token auth header // Token auth header
const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl) const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl)

View File

@ -6,7 +6,7 @@ import * as workflowContextHelper from './workflow-context-helper'
import {IGitSourceSettings} from './git-source-settings' import {IGitSourceSettings} from './git-source-settings'
export async function getInputs(): Promise<IGitSourceSettings> { export async function getInputs(): Promise<IGitSourceSettings> {
const result = ({} as unknown) as IGitSourceSettings const result = {} as unknown as IGitSourceSettings
// GitHub workspace // GitHub workspace
let githubWorkspacePath = process.env['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' (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE'
// Workflow organization ID // Workflow organization ID
result.workflowOrganizationId = await workflowContextHelper.getOrganizationId() result.workflowOrganizationId =
await workflowContextHelper.getOrganizationId()
// Set safe.directory in git global config. // Set safe.directory in git global config.
result.setSafeDirectory = result.setSafeDirectory =

View File

@ -23,7 +23,7 @@ export async function getCheckoutInfo(
throw new Error('Args ref and commit cannot both be empty') 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() const upperRef = (ref || '').toUpperCase()
// SHA only // SHA only

View File

@ -23,8 +23,9 @@ export async function getOrganizationId(): Promise<number | undefined> {
return id as number return id as number
} catch (err) { } catch (err) {
core.debug( core.debug(
`Unable to load organization ID from GITHUB_EVENT_PATH: ${(err as any) `Unable to load organization ID from GITHUB_EVENT_PATH: ${
.message || err}` (err as any).message || err
}`
) )
} }
} }