Skip to content

Commit c625bf7

Browse files
feat: allow to pass custom git actor to flarum/action-build (#4099)
* feat: allow to pass custom git actor to `action-build` * fix: syntax error * chore: tmp forked action build * chore: remove unused input * chore: revert back to original action * chore: bump flarum/action-build * fix: remove redefinition of GITHUB_TOKEN
1 parent fceae7f commit c625bf7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/REUSABLE_frontend.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,25 @@ on:
9292
required: false
9393
default: 'ubuntu-latest'
9494

95+
git_actor_name:
96+
description: The name of the git actor to use for the bundled JS output.
97+
type: string
98+
required: false
99+
git_actor_email:
100+
description: The email of the git actor to use for the bundled JS output.
101+
type: string
102+
required: false
103+
95104
secrets:
96105
bundlewatch_github_token:
97106
description: The GitHub token to use for Bundlewatch.
98107
required: false
99108
composer_auth:
100109
description: The Composer auth tokens to use for private packages.
101110
required: false
111+
git_actor_token:
112+
description: The personal access token from the custom git actor.
113+
required: false
102114

103115
env:
104116
COMPOSER_ROOT_VERSION: dev-main
@@ -111,13 +123,17 @@ jobs:
111123
build:
112124
name: Checks & Build
113125
runs-on: ${{ inputs.runner_type }}
126+
env:
127+
GIT_ACTOR_TOKEN: ${{ secrets.git_actor_token }}
114128

115129
if: >-
116130
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request')
117131
118132
steps:
119133
- name: Check out code
120134
uses: actions/checkout@v4
135+
with:
136+
token: ${{ secrets.git_actor_token != '' && secrets.git_actor_token || secrets.GITHUB_TOKEN }}
121137

122138
- name: Set up Node
123139
uses: actions/setup-node@v4
@@ -143,9 +159,8 @@ jobs:
143159
working-directory: ${{ inputs.frontend_directory }}
144160

145161
- name: JS Checks & Production Build
146-
uses: flarum/action-build@v4
162+
uses: flarum/action-build@v4.1
147163
with:
148-
github_token: ${{ secrets.GITHUB_TOKEN }}
149164
build_script: ${{ inputs.build_script }}
150165
build_typings_script: ${{ inputs.build_typings_script }}
151166
format_script: ${{ inputs.enable_prettier == true && inputs.format_script || '' }}
@@ -155,6 +170,8 @@ jobs:
155170
package_manager: ${{ inputs.js_package_manager }}
156171
js_path: ${{ inputs.frontend_directory }}
157172
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}
173+
git_actor_name: ${{ inputs.git_actor_name || '' }}
174+
git_actor_email: ${{ inputs.git_actor_email || '' }}
158175

159176
- name: Check bundle size change
160177
if: ${{ inputs.enable_bundlewatch }}

0 commit comments

Comments
 (0)