diff --git a/src/index.js b/src/index.js index c0d803b..113878d 100644 --- a/src/index.js +++ b/src/index.js @@ -24,7 +24,6 @@ async function run() { const { repository } = await tags.getAllTags(owner, repo, myToken); let tagsObj = tags.getTags(repository); - console.log('REPOSITORY: ', JSON.stringify(tagsObj)) const jsonUtils = new JsonUtils(tagsObj); if(prefix == '') { jsonUtils.filterNoPrefix() @@ -39,9 +38,7 @@ async function run() { } else { newVersion = `${prefix}1.0.0` } - - - + fs.appendFileSync(process.env.GITHUB_OUTPUT, "version=" + newVersion); const octokit = github.getOctokit(myToken) diff --git a/src/utils/get-tags.js b/src/utils/get-tags.js index b859afd..0c2eb9f 100644 --- a/src/utils/get-tags.js +++ b/src/utils/get-tags.js @@ -13,8 +13,6 @@ module.exports = class GetReleaseTags { getTags(jsonObj) { - console.log("JSON OBJ: ", JSON.stringify(jsonObj)) - // return jsonObj['refs']['nodes'][0]['repository']['releases']['nodes']; return jsonObj['releases']['nodes']; } @@ -25,47 +23,22 @@ module.exports = class GetReleaseTags { }, }); - console.log(`Owner: ${owner} - Repo: ${repo}`) - - // return await graphqlWithAuth( - // ` - // { - - // repository(owner: "${owner}", name: "${repo}") { - // refs(refPrefix: "refs/tags/", first: 1, query: "v3.0.0") { - // nodes { - // repository { - // releases(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) { - // nodes { - // name - // createdAt - // tagName - - // } - // } - // } - // } - // } - // } - // } - // ` - - // ); + return await graphqlWithAuth( ` { repository(owner: "${owner}", name: "${repo}") { - releases(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { - name - createdAt - tagName - - + releases(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { + name + createdAt + tagName + + } - } + } } } ` diff --git a/src/utils/json-utils.js b/src/utils/json-utils.js index fbadfe0..9fec487 100644 --- a/src/utils/json-utils.js +++ b/src/utils/json-utils.js @@ -42,7 +42,6 @@ module.exports = class JsonUtils { } firstItem(keyName) { - console.log("KEY NAME: ", JSON.stringify(this.jsonObj)) let first = this.jsonObj[0][keyName] return first } @@ -77,7 +76,6 @@ module.exports = class JsonUtils { } filterNoPrefix() { - console.log("INTERNAL OBJ: ", JSON.stringify(this.jsonObj)) let matched = _.filter(this.jsonObj, function(obj) { let o = obj.tagName.split('.')