Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const core = require('@actions/core');
const github = require('@actions/github');
const ActionUtils = require('../../../libs/ActionUtils');
const GitUtils = require('../../../libs/GitUtils');
const GithubUtils = require('../../../libs/GithubUtils');

const octokit = github.getOctokit(core.getInput('GITHUB_TOKEN', {required: true}));
const inputTag = core.getInput('TAG', {required: true});

const isProductionDeploy = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', {required: false}, false);
Expand All @@ -18,13 +18,13 @@ const itemToFetch = isProductionDeploy ? 'release' : 'tag';
*/
function getTagsOrReleases(fetchReleases) {
if (fetchReleases) {
return octokit.repos.listReleases({
return GithubUtils.octokit.repos.listReleases({

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an alternative would be to do octokit.rest.repos.listReleases() (ref), but this was the only place we don't use GithubUtils, so I went with that for consistency.

owner: github.context.repo.owner,
repo: github.context.repo.repo,
});
}

return octokit.repos.listTags({
return GithubUtils.octokit.repos.listTags({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
});
Expand Down
Loading