Pull "pick" action into clangd/actions (#552)

This commit is contained in:
Kirill Bobyrev 2020-10-06 10:40:21 +02:00 committed by GitHub
parent d1d8b39c4c
commit 5a40c019f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 106 deletions

View File

@ -1,15 +0,0 @@
name: 'Pick commit'
description: 'Pick last successful commit from a repo'
inputs:
repo:
description: 'Github repository e.g. llvm/llvm-project'
required: true
token:
description: 'Github auth token'
required: true
outputs:
sha:
description: 'The SHA1 of the picked commit'
runs:
using: 'node12'
main: 'index.js'

View File

@ -1,18 +0,0 @@
const core = require('@actions/core');
const last = require('last-successful-gh-commit').default;
try {
var parts = core.getInput('repo').split('/', 2);
last({
owner: parts[0],
name: parts[1],
token: core.getInput('token'),
})
.then(commit => core.setOutput('sha', commit.node.oid))
.catch(error => {
console.error(error);
core.setFailed(error.message);
});
} catch (error) {
console.error(error);
core.setFailed(error.message);
}

View File

@ -1,56 +0,0 @@
{
"name": "pick",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
},
"axios": {
"version": "0.16.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.16.2.tgz",
"integrity": "sha1-uk+S8XFn37q0CYN4VFS5rBScPG0=",
"requires": {
"follow-redirects": "^1.2.3",
"is-buffer": "^1.1.5"
}
},
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"requires": {
"ms": "^2.1.1"
}
},
"follow-redirects": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.10.0.tgz",
"integrity": "sha512-4eyLK6s6lH32nOvLLwlIOnr9zrL8Sm+OvW4pVTJNoXeGzYIkHVf+pADQi+OJ0E67hiuSLezPVPyBcIZO50TmmQ==",
"requires": {
"debug": "^3.0.0"
}
},
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"last-successful-gh-commit": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/last-successful-gh-commit/-/last-successful-gh-commit-1.0.1.tgz",
"integrity": "sha1-8Mn8HfEvb764g/5vrcy3W4p5EVo=",
"requires": {
"axios": "^0.16.2"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}
}
}

View File

@ -1,14 +0,0 @@
{
"name": "pick",
"version": "1.0.0",
"description": "Pick the last successful commit from a github repo",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "sam.mccall@gmail.com",
"license": "Apache-2.0",
"dependencies": {
"@actions/core": "^1.2.6",
"last-successful-gh-commit": "^1.0.1"
}
}

View File

@ -23,11 +23,9 @@ jobs:
steps:
- name: Clone scripts
uses: actions/checkout@v2
- name: Install NPM dependencies
run: npm install --prefix .github/actions/pick
- name: Pick last successful commit
id: pick
uses: ./.github/actions/pick
uses: clangd/actions/.github/actions/pick@v0.1.0
with:
repo: llvm/llvm-project
token: ${{ secrets.GITHUB_TOKEN }}