Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Experimental support to other repos
Browse files Browse the repository at this point in the history
  • Loading branch information
geoperez committed Feb 19, 2021
1 parent 0555a5b commit 93022f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
description: 'Action Type ( Release | Back )'
required: true
default: 'Release'
github_token:
github-token:
description: 'Token used to authenticate with GitHub when performing the merge command.'
required: false
default: ${{ github.token }}
Expand All @@ -20,6 +20,8 @@ inputs:
release-notes:
description: 'Tag Message'
required: true
repo:
description: 'If empty, current repo. Format @org/repo.'
runs:
using: node12
main: index.js
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ const ghUtilities = require("./utils");
const actions = require("./actions");

const actionType = core.getInput("action-type");
const token = core.getInput("github_token");
const token = core.getInput("github-token");
const sprint = core.getInput("sprint");
const releaseNotes = core.getInput("release-notes");
const prodBranch = core.getInput("prod-branch");
const repo = core.getInput("repo");

const gh = ghUtilities.getUtilities(token);
const gh = ghUtilities.getUtilities(repo, token);

const mergeBranch = async (choreBranchName) => {
const defaultBranchName = await gh.getDefaultBranch();
Expand Down
9 changes: 7 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const github = require("@actions/github");

const getUtilities = (token) => {
const getUtilities = (repoName, token) => {
const octokit = github.getOctokit(token);
const repo = github.context.repo;
const repo =
repoName && repoName.includes("/")
? { owner: repoName.split("/")[0], repo: repoName.split("/")[1] }
: github.context.repo;

console.log(`Init Repo ${repo.owner}/${repo.repo}`);

const createTag = async (objectSha, sprint, releaseNotes) => {
const tag = await octokit.git.createTag({
Expand Down

0 comments on commit 93022f8

Please sign in to comment.