Skip to content

feat: Ability to specify a custom user/email for git commits #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | [email protected] | 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. |
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]'
required: false
DRY_RUN:
description: "Run everything except for nothing will be Updated."
required: false
Expand Down
6 changes: 4 additions & 2 deletions src/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -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: '[email protected]',
GIT_USER,
GIT_EMAIL,
AUTO_CREATE_NEW_BRANCH,
COMMIT_EACH_FILE,
DRY_RUN,
Expand Down