From f0fbaf7521da62981c495d3a1d8f30cc16e6a46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gro=C3=9Fe?= Date: Fri, 8 Oct 2021 08:43:30 +0200 Subject: [PATCH 1/3] feat: add configurable user and token --- action.yml | 8 ++++++++ dist/index.cjs | 6 ++++-- lib/index.js | 6 ++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 6e4a642a..294f4da3 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,14 @@ inputs: description: "GitHub token" required: false default: ${{ github.token }} + github_user: + description: "Git user name for commit changes" + default: "Github Actions" + required: false + github_email: + description: "Git user email for commit changes" + default: "no-reply-actions@github.com" + required: false branch: description: "Created branch" required: false diff --git a/dist/index.cjs b/dist/index.cjs index c7df9bf7..273c2370 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -9705,7 +9705,9 @@ async function run() { baseBranch = await getDefaultBranch({ token, repository }); } - const author = getFromEnv("GITHUB_ACTOR"); + const author = core.getInput("github_user"); + const email = core.getInput("github_email"); + return createOrUpdatePullRequest({ branch: core.getInput("branch"), token, @@ -9715,7 +9717,7 @@ async function run() { commitBody: buildCommitBody(report), repository, author, - email: `${author}@users.noreply.github.com`, + email, labels: commaSeparatedList(core.getInput("labels")), }); }); diff --git a/lib/index.js b/lib/index.js index 4e0e607b..6957c2c4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -84,7 +84,9 @@ async function run() { baseBranch = await getDefaultBranch({ token, repository }); } - const author = getFromEnv("GITHUB_ACTOR"); + const author = core.getInput("github_user"); + const email = core.getInput("github_email"); + return createOrUpdatePullRequest({ branch: core.getInput("branch"), token, @@ -94,7 +96,7 @@ async function run() { commitBody: buildCommitBody(report), repository, author, - email: `${author}@users.noreply.github.com`, + email, labels: commaSeparatedList(core.getInput("labels")), }); }); From b137775e86fc6bfda5e6d364030f5ee6460fcf27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gro=C3=9Fe?= Date: Fri, 8 Oct 2021 15:02:46 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 294f4da3..fc5f9cb0 100644 --- a/action.yml +++ b/action.yml @@ -8,11 +8,11 @@ inputs: default: ${{ github.token }} github_user: description: "Git user name for commit changes" - default: "Github Actions" + default: ${{ github.actor }} required: false github_email: description: "Git user email for commit changes" - default: "no-reply-actions@github.com" + default: "${{ github.actor }}@users.noreply.github.com" required: false branch: description: "Created branch" From e7221d661733719b78f27ee31daf2daab2b33d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gro=C3=9Fe?= Date: Mon, 11 Oct 2021 09:20:55 +0200 Subject: [PATCH 3/3] doc: change description Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index fc5f9cb0..7c5f3c5e 100644 --- a/action.yml +++ b/action.yml @@ -7,11 +7,11 @@ inputs: required: false default: ${{ github.token }} github_user: - description: "Git user name for commit changes" + description: "GitHub user name for commit changes" default: ${{ github.actor }} required: false github_email: - description: "Git user email for commit changes" + description: "GitHub user email for commit changes" default: "${{ github.actor }}@users.noreply.github.com" required: false branch: