Support customized branch for committing (#51)

This commit is contained in:
Aleen
2021-01-12 04:17:55 +08:00
committed by GitHub
parent 4ef1b7367b
commit d05c1bbdf4
2 changed files with 7 additions and 2 deletions

View File

@@ -15,6 +15,11 @@ inputs:
description: GitHub Token used to commit metrics
default: ""
# Branch to commit
committer_branch:
description: The branch used to commit metrics
default: ""
# GitHub username
# Optional, as it defaults "token"'s owner
user:
@@ -551,4 +556,4 @@ runs:
METRICS_ACTION: ${{ github.action }}
METRICS_ACTION_PATH: ${{ github.action_path }}
METRICS_USE_PREBUILT_IMAGE: ${{ inputs.use_prebuilt_image }}
INPUTS: ${{ toJson(inputs) }}
INPUTS: ${{ toJson(inputs) }}

View File

@@ -257,7 +257,7 @@
info("Dry-run", "complete")
else {
//Repository and branch
const branch = github.context.ref.replace(/^refs[/]heads[/]/, "")
const branch = input.string("committer_branch", {default:github.context.ref.replace(/^refs[/]heads[/]/, "")})
info("Current repository", `${github.context.repo.owner}/${github.context.repo.repo}`)
info("Current branch", branch)
//Committer token