You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `build_script` | Yes | The `package.json` script to run to build your extension JS. | `build` | `build` |
42
40
| `build_typings_script` | No | If defined, runs the script of this name in `package.json` to build typings for your extension. | `build-typings` | Unset |
43
41
| `format_script` | No | If defined, runs the script of this name in `package.json` to check code formatting of your extension's JS. | `format-check` | Unset |
@@ -49,13 +47,81 @@ Here is a full list of options available using the `with` syntax:
49
47
| `do_not_commit` | No | Set to `true` to NOT commit the built JS/Typings. Useful for validating JS source. | `false` | `false` |
50
48
| `checks` | No | An array of strings, where each is a script that should be run before committing built js. | `false` | `false` |
51
49
| `commit_all_dirty` | No | Set to `true` to commit all file changes, not just files in the dist JS directory. | `false` | `false` |
50
+
| `git_actor_name` | No | Allows to set a different username (normally `flarum-bot`) for the actor which commits the bundles JS. | `acme-bot` | Unset |
51
+
| `git_actor_email` | No | Allows to set a different email for the actor which commits the bundled JS. | `[email protected]` | Unset |
52
52
53
53
### Assumptions
54
54
55
55
Your Javascript must be in a `js` folder, similar to how Flarum core and Flarum's first-party extensions are laid out.
56
56
57
57
If building typings, we assume that they are built to `js/dist-typings`, as set in the example `tsconfig.json` found on the [flarum-tsconfig](https://github.com/flarum/flarum-tsconfig).
58
58
59
+
## Setting Up Custom Git Actor for Frontend Workflow
60
+
61
+
This guide helps you configure a custom Git actor in your extension's frontend workflow, specifically useful if your organization enforces branch protection rules requiring pull requests for changes to the default branch.
62
+
63
+
### Basic Configuration (Light Version)
64
+
65
+
To change the actor committing bundled JS in your workflow:
66
+
67
+
1. Add `git_actor_name` and `git_actor_email` inputs to your workflow file.
68
+
2. These values can represent either a real GitHub user or a fictional one.
69
+
3. If using a real user, it's recommended to use the GitHub-provided email for privacy-enabled accounts.
If you also want to enforce branch protection and allow a custom actor to bypass pull requests:
91
+
92
+
1. Create a dedicated CI GitHub account with admin permissions in your organization.
93
+
2. Generate a Personal Access Token for the CI account:
94
+
95
+
- Go to [GitHub Tokens](https://github.com/settings/tokens/new) and create a new token with repo and workflow scopes.
96
+
97
+
3. Add the token as a secret in your repository.
98
+
4. Use the real CI account's username and email in your workflow.
99
+
100
+
When setting branch protection rules, make sure not to enable "Do not allow bypassing the above settings" as this would block automated commits from the CI actor.
- Avoid the "Do not allow bypassing the above settings" option when setting up branch protection, or your CI actor won’t be able to commit the bundled JS.
123
+
- Make sure other rules or permissions don't block the CI account from making automated commits.
124
+
59
125
## Only Build on Master
60
126
61
127
If you only want to run the workflow when commits are pushed to the `master` branch, change `on: push` to the following:
0 commit comments