3
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2024-11-25 20:39:32 +01:00

Merge branch 'main' into jwi-pathdocu

This commit is contained in:
Johnny Willemsen 2020-10-02 17:20:12 +02:00
commit 8af5cbfde0
No known key found for this signature in database
GPG key ID: CCE55DD593057AD0
68 changed files with 58 additions and 1339 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
.licenses/** -diff linguist-generated=true

20
.github/workflows/licensed.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: Licensed
on:
push: {branches: main}
pull_request: {branches: main}
jobs:
test:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v2
- run: npm ci
- name: Install licensed
run: |
cd $RUNNER_TEMP
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
sudo tar -xzf licensed.tar.gz
sudo mv licensed /usr/local/bin/licensed
- run: licensed status

14
.licensed.yml Normal file
View file

@ -0,0 +1,14 @@
sources:
npm: true
allowed:
- apache-2.0
- bsd-2-clause
- bsd-3-clause
- isc
- mit
- cc0-1.0
- unlicense
reviewed:
npm:

BIN
.licenses/npm/@actions/core.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@actions/exec.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@actions/github.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@actions/http-client.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@actions/io.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@actions/tool-cache.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/@octokit/auth-token.dep.yml generated Normal file

Binary file not shown.

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

Binary file not shown.

BIN
.licenses/npm/@octokit/graphql.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/@octokit/request.dep.yml generated Normal file

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

BIN
.licenses/npm/@types/node.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/atob-lite.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/before-after-hook.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/btoa-lite.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/cross-spawn.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/deprecation.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/end-of-stream.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/execa.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/get-stream.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/is-plain-object.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/is-stream.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/isexe.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/isobject.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/lodash.get.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/lodash.set.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/lodash.uniq.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/macos-release.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/nice-try.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/node-fetch.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/npm-run-path.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/once.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/os-name.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/p-finally.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/path-key.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/pump.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/semver-5.7.1.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/semver-6.3.0.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/shebang-command.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/shebang-regex.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/signal-exit.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/strip-eof.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/tunnel-0.0.4.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/tunnel-0.0.6.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/typed-rest-client.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/underscore.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/uuid.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/which.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/windows-release.dep.yml generated Normal file

Binary file not shown.

BIN
.licenses/npm/wrappy.dep.yml generated Normal file

Binary file not shown.

View file

@ -2,5 +2,5 @@
mkdir override-git-version mkdir override-git-version
cd override-git-version cd override-git-version
echo @echo override git version 1.2.3 > git.cmd echo @echo override git version 1.2.3 > git.cmd
echo ::add-path::%CD% echo "%CD%" >> $GITHUB_PATH
cd .. cd ..

View file

@ -5,5 +5,5 @@ cd override-git-version
echo "#!/bin/sh" > git echo "#!/bin/sh" > git
echo "echo override git version 1.2.3" >> git echo "echo override git version 1.2.3" >> git
chmod +x git chmod +x git
echo "::add-path::$(pwd)" echo "$(pwd)" >> $GITHUB_PATH
cd .. cd ..

13
dist/index.js vendored
View file

@ -5883,9 +5883,11 @@ class GitCommandManager {
yield this.execGit(['lfs', 'install', '--local']); yield this.execGit(['lfs', 'install', '--local']);
}); });
} }
log1() { log1(format) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const output = yield this.execGit(['log', '-1']); var args = format ? ['log', '-1', format] : ['log', '-1'];
var silent = format ? false : true;
const output = yield this.execGit(args, false, silent);
return output.stdout; return output.stdout;
}); });
} }
@ -6007,7 +6009,7 @@ class GitCommandManager {
return result; return result;
}); });
} }
execGit(args, allowAllExitCodes = false) { execGit(args, allowAllExitCodes = false, silent = false) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
fshelper.directoryExistsSync(this.workingDirectory, true); fshelper.directoryExistsSync(this.workingDirectory, true);
const result = new GitOutput(); const result = new GitOutput();
@ -6022,6 +6024,7 @@ class GitCommandManager {
const options = { const options = {
cwd: this.workingDirectory, cwd: this.workingDirectory,
env, env,
silent,
ignoreReturnCode: allowAllExitCodes, ignoreReturnCode: allowAllExitCodes,
listeners: { listeners: {
stdout: (data) => { stdout: (data) => {
@ -6267,8 +6270,10 @@ function getSource(settings) {
yield authHelper.removeGlobalAuth(); yield authHelper.removeGlobalAuth();
} }
} }
// Dump some info about the checked out commit // Get commit information
const commitInfo = yield git.log1(); const commitInfo = yield git.log1();
// Log commit sha
yield git.log1("--format='%H'");
// Check for incorrect pull request merge commit // Check for incorrect pull request merge commit
yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit); yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
} }

1328
dist/licenses.txt vendored

File diff suppressed because it is too large Load diff

View file

@ -31,7 +31,7 @@ export interface IGitCommandManager {
isDetached(): Promise<boolean> isDetached(): Promise<boolean>
lfsFetch(ref: string): Promise<void> lfsFetch(ref: string): Promise<void>
lfsInstall(): Promise<void> lfsInstall(): Promise<void>
log1(): Promise<string> log1(format?: string): Promise<string>
remoteAdd(remoteName: string, remoteUrl: string): Promise<void> remoteAdd(remoteName: string, remoteUrl: string): Promise<void>
removeEnvironmentVariable(name: string): void removeEnvironmentVariable(name: string): void
revParse(ref: string): Promise<string> revParse(ref: string): Promise<string>
@ -254,8 +254,10 @@ class GitCommandManager {
await this.execGit(['lfs', 'install', '--local']) await this.execGit(['lfs', 'install', '--local'])
} }
async log1(): Promise<string> { async log1(format?: string): Promise<string> {
const output = await this.execGit(['log', '-1']) var args = format ? ['log', '-1', format] : ['log', '-1']
var silent = format ? false : true
const output = await this.execGit(args, false, silent)
return output.stdout return output.stdout
} }
@ -390,7 +392,8 @@ class GitCommandManager {
private async execGit( private async execGit(
args: string[], args: string[],
allowAllExitCodes = false allowAllExitCodes = false,
silent = false
): Promise<GitOutput> { ): Promise<GitOutput> {
fshelper.directoryExistsSync(this.workingDirectory, true) fshelper.directoryExistsSync(this.workingDirectory, true)
@ -409,6 +412,7 @@ class GitCommandManager {
const options = { const options = {
cwd: this.workingDirectory, cwd: this.workingDirectory,
env, env,
silent,
ignoreReturnCode: allowAllExitCodes, ignoreReturnCode: allowAllExitCodes,
listeners: { listeners: {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {

View file

@ -201,9 +201,12 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
} }
} }
// Dump some info about the checked out commit // Get commit information
const commitInfo = await git.log1() const commitInfo = await git.log1()
// Log commit sha
await git.log1("--format='%H'")
// Check for incorrect pull request merge commit // Check for incorrect pull request merge commit
await refHelper.checkCommitInfo( await refHelper.checkCommitInfo(
settings.authToken, settings.authToken,