Skip to content

Commit 8f06c53

Browse files
feat: allow to use custom actor
1 parent 73c39c9 commit 8f06c53

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,9 @@ inputs:
4343
description: Set to `true` to commit all file changes, not just files in the dist JS directory.
4444
default: 'false'
4545
required: false
46+
git_actor_name:
47+
description: The name of the git actor to use for the bundled JS output.
48+
required: false
49+
git_actor_email:
50+
description: The email of the git actor to use for the bundled JS output.
51+
required: false

src/jobs/commitChangesToGit.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ export default async function commitChangesToGit(jp: FSJetpack): Promise<void> {
2424
maxConcurrentProcesses: 1,
2525
};
2626

27+
const gitActorName = core.getInput('git_actor_name', { required: false, trimWhitespace: true }) || 'flarum-bot';
28+
const gitActorEmail = core.getInput('git_actor_email', { required: false, trimWhitespace: true }) || '[email protected]';
29+
2730
const config = {
2831
author: {
29-
name: 'flarum-bot',
30-
32+
name: gitActorName,
33+
email: gitActorEmail,
3134
},
3235
};
3336

@@ -61,11 +64,9 @@ Includes transpiled JS/TS${core.getInput('build_typings_script') !== '' ? ', and
6164
6265
[skip ci]`);
6366

64-
const token = core.getInput('github_token', { required: true, trimWhitespace: true });
65-
6667
debugLog(`** Pushing commit`);
6768

68-
await git.addRemote('upstream', `https://${process.env.GITHUB_ACTOR}:${token}@github.com/${process.env.GITHUB_REPOSITORY}.git`);
69+
await git.addRemote('upstream', `https://github-actions:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`);
6970

7071
log(`${status}`);
7172

0 commit comments

Comments
 (0)