mirror of
https://github.com/actions/checkout.git
synced 2025-03-28 11:00:05 +01:00
.
This commit is contained in:
parent
d488e10623
commit
a42f444fdc
3 changed files with 9 additions and 9 deletions
|
@ -63,7 +63,7 @@ describe('input-helper tests', () => {
|
|||
it('sets defaults', () => {
|
||||
const settings: ISourceSettings = inputHelper.getInputs()
|
||||
expect(settings).toBeTruthy()
|
||||
expect(settings.accessToken).toBeFalsy()
|
||||
expect(settings.authToken).toBeFalsy()
|
||||
expect(settings.clean).toBe(true)
|
||||
expect(settings.commit).toBeTruthy()
|
||||
expect(settings.commit).toBe('1234567890123456789012345678901234567890')
|
||||
|
|
8
dist/index.js
vendored
8
dist/index.js
vendored
|
@ -8405,12 +8405,12 @@ const retryHelper = __importStar(__webpack_require__(587));
|
|||
const toolCache = __importStar(__webpack_require__(533));
|
||||
const v4_1 = __importDefault(__webpack_require__(826));
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPath) {
|
||||
function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Download the archive
|
||||
let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
||||
core.info('Downloading the archive');
|
||||
return yield downloadArchive(accessToken, owner, repo, ref, commit);
|
||||
return yield downloadArchive(authToken, owner, repo, ref, commit);
|
||||
}));
|
||||
// Write archive to disk
|
||||
core.info('Writing archive to disk');
|
||||
|
@ -8451,9 +8451,9 @@ function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPat
|
|||
});
|
||||
}
|
||||
exports.downloadRepository = downloadRepository;
|
||||
function downloadArchive(accessToken, owner, repo, ref, commit) {
|
||||
function downloadArchive(authToken, owner, repo, ref, commit) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const octokit = new github.GitHub(accessToken);
|
||||
const octokit = new github.GitHub(authToken);
|
||||
const params = {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
|
|
|
@ -12,7 +12,7 @@ import {ReposGetArchiveLinkParams} from '@octokit/rest'
|
|||
const IS_WINDOWS = process.platform === 'win32'
|
||||
|
||||
export async function downloadRepository(
|
||||
accessToken: string,
|
||||
authToken: string,
|
||||
owner: string,
|
||||
repo: string,
|
||||
ref: string,
|
||||
|
@ -22,7 +22,7 @@ export async function downloadRepository(
|
|||
// Download the archive
|
||||
let archiveData = await retryHelper.execute(async () => {
|
||||
core.info('Downloading the archive')
|
||||
return await downloadArchive(accessToken, owner, repo, ref, commit)
|
||||
return await downloadArchive(authToken, owner, repo, ref, commit)
|
||||
})
|
||||
|
||||
// Write archive to disk
|
||||
|
@ -68,13 +68,13 @@ export async function downloadRepository(
|
|||
}
|
||||
|
||||
async function downloadArchive(
|
||||
accessToken: string,
|
||||
authToken: string,
|
||||
owner: string,
|
||||
repo: string,
|
||||
ref: string,
|
||||
commit: string
|
||||
): Promise<Buffer> {
|
||||
const octokit = new github.GitHub(accessToken)
|
||||
const octokit = new github.GitHub(authToken)
|
||||
const params: ReposGetArchiveLinkParams = {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
|
|
Loading…
Add table
Reference in a new issue