Skip to content

Commit

Permalink
feat: add log.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 28, 2024
1 parent b18af62 commit 618e2a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44970,7 +44970,7 @@ var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_);
* @returns
*/function getReleaseURL(_x){return _getReleaseURL.apply(this,arguments);}function _getReleaseURL(){_getReleaseURL=(0,asyncToGenerator/* default */.A)(/*#__PURE__*/(0,regeneratorRuntime/* default */.A)().mark(function _callee(tag){var _context$repo,owner,repo,tagName,myToken,currentTag,octokit,getReleaseResponse;return (0,regeneratorRuntime/* default */.A)().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context$repo=github.context.repo,owner=_context$repo.owner,repo=_context$repo.repo;// Get the tag name from the triggered action
tagName=github.context.ref;myToken=(0,core.getInput)('token');// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.12.23' to 'v1.12.23'
currentTag=tag||tagName.replace("refs/tags/","");octokit=(0,github.getOctokit)(myToken);(0,core.info)("Getting release for tag: ".concat(currentTag));// Get a release from the tag name
currentTag=tag||tagName.replace("refs/tags/","");octokit=(0,github.getOctokit)(myToken);(0,core.info)("Getting release for tag: ".concat(currentTag," \n owner: ").concat(owner," \n repo: ").concat(repo));// Get a release from the tag name
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
// Octokit Documentation: https://octokit.github.io/rest.js/#octokit-routes-repos-create-release
_context.next=8;return octokit.rest.repos.getReleaseByTag({owner:owner,repo:repo,tag:currentTag});case 8:getReleaseResponse=_context.sent;return _context.abrupt("return",getReleaseResponse.data);case 10:case"end":return _context.stop();}},_callee);}));return _getReleaseURL.apply(this,arguments);}function getAssetName(assetPath){try{return JSON.parse(assetPath);}catch(error){if(assetPath){return assetPath;}}return undefined;}// Function to upload the file
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function getReleaseURL(tag: string | undefined) {
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.12.23' to 'v1.12.23'
const currentTag = tag || tagName.replace("refs/tags/", "");
const octokit = getOctokit(myToken);
info(`Getting release for tag: ${currentTag}`);
info(`Getting release for tag: ${currentTag} \n owner: ${owner} \n repo: ${repo}`);
// Get a release from the tag name
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
// Octokit Documentation: https://octokit.github.io/rest.js/#octokit-routes-repos-create-release
Expand Down

0 comments on commit 618e2a1

Please sign in to comment.