mirror of
https://github.com/actions/checkout.git
synced 2024-12-22 08:37:44 +01:00
.
This commit is contained in:
parent
ad6dd29a96
commit
4af80cb867
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
@ -12,26 +12,26 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1 # todo: switch to v2
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm run format-check
|
||||
- run: npm run lint
|
||||
- run: npm run pack
|
||||
- run: npm run gendocs
|
||||
- name: Verify no unstaged changes
|
||||
run: __test__/verify-no-unstaged-changes.sh
|
||||
- uses: actions/checkout@v2-beta
|
||||
# - run: npm ci
|
||||
# - run: npm run build
|
||||
# - run: npm run format-check
|
||||
# - run: npm run lint
|
||||
# - run: npm run pack
|
||||
# - run: npm run gendocs
|
||||
# - name: Verify no unstaged changes
|
||||
# run: __test__/verify-no-unstaged-changes.sh
|
||||
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
runs-on: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
# test:
|
||||
# strategy:
|
||||
# matrix:
|
||||
# runs-on: [ubuntu-latest, macos-latest, windows-latest]
|
||||
# runs-on: ${{ matrix.runs-on }}
|
||||
|
||||
steps:
|
||||
# Clone this repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1 # todo: switch to V2
|
||||
# steps:
|
||||
# # Clone this repo
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v1 # todo: switch to V2
|
||||
|
||||
# Basic checkout
|
||||
- name: Basic checkout
|
||||
|
92
dist/index.js
vendored
92
dist/index.js
vendored
@ -4807,7 +4807,7 @@ const gitCommandManager = __importStar(__webpack_require__(289));
|
||||
const io = __importStar(__webpack_require__(1));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
const refHelper = __importStar(__webpack_require__(227));
|
||||
const repositoryApiHelper = __importStar(__webpack_require__(610));
|
||||
const githubApiHelper = __importStar(__webpack_require__(464));
|
||||
const authConfigKey = `http.https://github.com/.extraheader`;
|
||||
function getSource(settings) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
@ -4844,7 +4844,7 @@ function getSource(settings) {
|
||||
yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
|
||||
}
|
||||
if (!git || `${1}` == '1') {
|
||||
yield repositoryApiHelper.download(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
|
||||
yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
|
||||
}
|
||||
else {
|
||||
// Initialize the repository
|
||||
@ -8063,6 +8063,50 @@ exports.RequestError = RequestError;
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 464:
|
||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const github = __importStar(__webpack_require__(469));
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
function downloadRepository(accessToken, owner, repo, ref, repositoryPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const octokit = new github.GitHub(accessToken);
|
||||
const params = {
|
||||
archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
ref: ref
|
||||
};
|
||||
const response = yield octokit.repos.getArchiveLink(params);
|
||||
console.log(`status=${response.status}`);
|
||||
console.log(`headers=${JSON.stringify(response.headers)}`);
|
||||
console.log(`data=${JSON.stringify(typeof (response.data))}`);
|
||||
});
|
||||
}
|
||||
exports.downloadRepository = downloadRepository;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 469:
|
||||
@ -8932,50 +8976,6 @@ function octokitRestApiEndpoints(octokit) {
|
||||
|
||||
module.exports = require("http");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 610:
|
||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const github = __importStar(__webpack_require__(469));
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
function download(accessToken, owner, repo, ref, repositoryPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const octokit = new github.GitHub(accessToken);
|
||||
const params = {
|
||||
archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
ref: ref
|
||||
};
|
||||
const response = yield octokit.repos.getArchiveLink(params);
|
||||
console.log(`status=${response.status}`);
|
||||
console.log(`headers=${JSON.stringify(response.headers)}`);
|
||||
console.log(`data=${JSON.stringify(response.data)}`);
|
||||
});
|
||||
}
|
||||
exports.download = download;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 614:
|
||||
|
@ -6,7 +6,7 @@ import * as gitCommandManager from './git-command-manager'
|
||||
import * as io from '@actions/io'
|
||||
import * as path from 'path'
|
||||
import * as refHelper from './ref-helper'
|
||||
import * as repositoryApiHelper from './repository-api-helper'
|
||||
import * as githubApiHelper from './github-api-helper'
|
||||
import {IGitCommandManager} from './git-command-manager'
|
||||
|
||||
const authConfigKey = `http.https://github.com/.extraheader`
|
||||
@ -79,7 +79,7 @@ export async function getSource(settings: ISourceSettings): Promise<void> {
|
||||
}
|
||||
|
||||
if (!git || `${1}` == '1') {
|
||||
await repositoryApiHelper.download(
|
||||
await githubApiHelper.downloadRepository(
|
||||
settings.accessToken,
|
||||
settings.repositoryOwner,
|
||||
settings.repositoryName,
|
||||
|
@ -3,7 +3,7 @@ import {ReposGetArchiveLinkParams} from '@octokit/rest'
|
||||
|
||||
const IS_WINDOWS = process.platform === 'win32'
|
||||
|
||||
export async function download(
|
||||
export async function downloadRepository(
|
||||
accessToken: string,
|
||||
owner: string,
|
||||
repo: string,
|
||||
@ -20,5 +20,5 @@ export async function download(
|
||||
const response = await octokit.repos.getArchiveLink(params)
|
||||
console.log(`status=${response.status}`)
|
||||
console.log(`headers=${JSON.stringify(response.headers)}`)
|
||||
console.log(`data=${JSON.stringify(response.data)}`)
|
||||
console.log(`data=${JSON.stringify(typeof response.data)}`)
|
||||
}
|
Loading…
Reference in New Issue
Block a user