Skip to content

Commit 6496908

Browse files
authored
Merge pull request #32 from FasterSpeeding/task/override-committer
Support passing through overrides for the commit author
2 parents 8ff09e4 + 7e4ef40 commit 6496908

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ Input parameter | Description
105105
`token` | Authentication token for the preview deployment. <br> The default value works for non-fork pull requests to the same repository. For anything else, you will need a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with permission to access it, and [store it as a secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) in your repository. E.g. you might name that secret 'PREVIEW_TOKEN' and use it with `token: ${{ secrets.PREVIEW_TOKEN }}`. <br><br> Default: `${{ github.token }}`, which gives the action permission to deploy to the current repository.
106106
`action` <br> (enum) | Determines what this action will do when it is executed. Supported values: <br><br> <ul><li>`deploy` - create and deploy the preview, overwriting any existing preview in that location.</li><li>`remove` - remove the preview.</li><li>`auto` - determine whether to deploy or remove the preview based on [the emitted event](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request). If the event is `pull_request`, it will deploy the preview when the event type is `opened`, `reopened` and `synchronize`, and remove it on `closed` events. Does not do anything for other events or event types, even if you explicitly instruct the workflow to run on them.</li><li>`none` and all other values: does not do anything.</li></ul> Default: `auto`
107107

108+
<details>
109+
<summary><b>Extra parameters for controlling the commits</b></summary>
110+
111+
| Input&nbsp;parameter | Description |
112+
| --- | --- |
113+
| `git-config-name` | The git user.name to use for the deployment commit. <br><br> Default: The user who created the `token` |
114+
| `git-config-email` | The git user.email to use for the deployment commit. <br><br> Default: The user who created the `token` |
115+
116+
</details>
117+
108118
## Outputs
109119

110120
Several output values are provided to use after this Action in your workflow. To use them, give this Action's step an `id` and reference the value with `${{ steps.<id>.outputs.<name> }}`, e.g.:

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ inputs:
5353
description: Whether to leave a sticky comment on the calling PR.
5454
required: false
5555
default: "true"
56+
git-config-name:
57+
description: The git user.name to use for the deployment commit.
58+
required: false
59+
git-config-email:
60+
description: The git user.email to use for the deployment commit.
61+
required: false
5662

5763
custom-url:
5864
description: Deprecated, use `pages-base-url` instead.
@@ -135,6 +141,8 @@ runs:
135141
target-folder: ${{ env.preview_file_path }}
136142
commit-message: Deploy preview for PR ${{ github.event.number }} 🛫
137143
force: false
144+
git-config-name: ${{ inputs.git-config-name }}
145+
git-config-email: ${{ inputs.git-config-email }}
138146

139147
- name: Leave a comment after deployment
140148
if: |
@@ -161,6 +169,8 @@ runs:
161169
target-folder: ${{ env.preview_file_path }}
162170
commit-message: Remove preview for PR ${{ github.event.number }} 🛬
163171
force: false
172+
git-config-name: ${{ inputs.git-config-name }}
173+
git-config-email: ${{ inputs.git-config-email }}
164174

165175
- name: Leave a comment after removal
166176
if: |

0 commit comments

Comments
 (0)