mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-08 00:37:27 +00:00
More testing
This commit is contained in:
parent
8a260b16ec
commit
aa31d0ee14
1 changed files with 17 additions and 9 deletions
26
index.js
26
index.js
|
|
@ -1,15 +1,7 @@
|
|||
const core = require('@actions/core');
|
||||
const { Octokit } = require("@octokit/rest");
|
||||
|
||||
try {
|
||||
const versionPrefix = "v1."
|
||||
const token = core.getInput('token');
|
||||
const version = core.getInput('version');
|
||||
const org = core.getInput("org")
|
||||
const repo = core.getInput("repo")
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
})
|
||||
async function downloadGofmt(octokit, version, versionPrefix, org, repo) {
|
||||
if (version !== "") {
|
||||
if (!version.startsWith(versionPrefix)) {
|
||||
throw "Specified version " + version + " does not start with required version prefix " + versionPrefix + "."
|
||||
|
|
@ -24,6 +16,22 @@ try {
|
|||
for (let release of releases) {
|
||||
console.log(release)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const versionPrefix = "v1."
|
||||
const token = core.getInput('token');
|
||||
const version = core.getInput('version');
|
||||
const org = core.getInput("org")
|
||||
const repo = core.getInput("repo")
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
})
|
||||
downloadGofmt(octokit, version, versionPrefix, org, repo).then(function () {
|
||||
console.log("Download successful.")
|
||||
}).catch(reason => function() {
|
||||
core.setFailed(reason);
|
||||
})
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
Loading…
Reference in a new issue