diff --git a/README.md b/README.md index d2152ab..a3d07ef 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ This also isn't limited to Github Action yaml files - another use case could be | --- | :---: | :---: | | `GITHUB_TOKEN` | - | **Required** Token to use to get repos and write secrets. `${{secrets.GITHUB_TOKEN}}` will not work. instead **Personal Access Token Required*** | | `GIT_URL` | github.com | URL for the instance of github, where repositories should be searched for. Change if using a GHES instance. | +| `GIT_USER` | Workflow Sync Bot | The name of the user to use for git commits. | +| `GIT_EMAIL` | githubactionbot+workflowsync@gmail.com | The email of the user to use for git commits. | | `REPOSITORIES` | - | **Required** New line deliminated regex expressions to select repositories. Repositires are limited to those in whcich the token user is an owner or collaborator. | | `WORKFLOW_FILES` | - | **Required** New line deliminated regex expressions. workflow files to be copied to provided repositores | | `DRY_RUN` | ***false*** | Run everything except for nothing will be pushed. | diff --git a/action.yml b/action.yml index 9f4119d..ac172b4 100644 --- a/action.yml +++ b/action.yml @@ -24,6 +24,14 @@ inputs: description: "The URL to the Github server. Defaults to github.com. Change if using a GHES instance." default: 'github.com' required: false + GIT_USER: + description: "The name of the user to use for git commits." + default: 'Workflow Sync Bot' + required: false + GIT_EMAIL: + description: "The email of the user to use for git commits." + default: 'githubactionbot+workflowsync@gmail.com' + required: false DRY_RUN: description: "Run everything except for nothing will be Updated." required: false diff --git a/src/variables.js b/src/variables.js index 5ba2f34..be870f1 100644 --- a/src/variables.js +++ b/src/variables.js @@ -8,6 +8,8 @@ const PULL_REQUEST = toolkit.input.tobool( core.getInput( 'PULL_REQUES const SKIP_CI = toolkit.input.tobool( core.getInput( 'SKIP_CI' ) ); const GITHUB_TOKEN = core.getInput( 'GITHUB_TOKEN' ); const GIT_URL = core.getInput( 'GIT_URL' ); +const GIT_USER = core.getInput( 'GIT_USER' ); +const GIT_EMAIL = core.getInput( 'GIT_EMAIL' ); const RAW_REPOSITORIES = core.getInput( 'REPOSITORIES' ); const COMMIT_MESSAGE = core.getInput( 'COMMIT_MESSAGE' ); const RAW_WORKFLOW_FILES = core.getInput( 'WORKFLOW_FILES' ); @@ -19,8 +21,8 @@ const GITHUB_WORKSPACE = toolkit.input.env( 'GITHUB_WORKSPACE' ); const WORKSPACE = toolkit.path.dirname( toolkit.path.dirname( GITHUB_WORKSPACE ) ) + '/workflow-sync/'; module.exports = { - GIT_USER: 'Workflow Sync Bot', - GIT_EMAIL: 'githubactionbot+workflowsync@gmail.com', + GIT_USER, + GIT_EMAIL, AUTO_CREATE_NEW_BRANCH, COMMIT_EACH_FILE, DRY_RUN,