Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Nov 14, 2023
1 parent 159c716 commit cadf8b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ branding:
color: orange

inputs:
token:
default: ${{ github.token }}
git-version: {}
user:
default: github-actions[bot]
Expand Down
14 changes: 9 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const githubContext = {

function getNameEmailInput(
input: string,
options: { required: true },
options: { required: true }
): [string, string];
function getNameEmailInput(
input: string,
options?: { required?: boolean },
options?: { required?: boolean }
): [string | null, string | null];
function getNameEmailInput(
input: string,
options: { required?: boolean } = {},
options: { required?: boolean } = {}
) {
const { required = false } = options;
const githubActionsRe = /^\s*@?github[-_]?actions(?:\[bot\])?\s*$/;
Expand Down Expand Up @@ -56,5 +56,9 @@ if (userName && userEmail) {
await $({ stdio: "inherit" })`git config --global user.email ${userEmail}`;
}

const { hostname } = new URL(githubContext.server_url)
await $({ stdio: "inherit" })`gh auth setup-git --hostname ${hostname}`
const { hostname } = new URL(githubContext.server_url);
const GITHUB_TOKEN = core.getInput("token");
await $({
stdio: "inherit",
env: { GITHUB_TOKEN },
})`gh auth setup-git --hostname ${hostname}`;

0 comments on commit cadf8b3

Please sign in to comment.