action: prepare prepares for creating a commit.
- Download fixed files and metadata from GitHub Actions Artifacts
- Get data about associated Workflow Run, Pull Request, and Branch by GitHub API
- Validate the request
- Output data for custom validation and creating a commit
action: Must beprepareapp_id: A GitHub App IDapp_private_key: A GitHub App Private Key
allow_workflow_fix: Eithertrueorfalse. The default isfalse. Iftrue, the action can fix workflow files. You need to grantworkflows:writepermission to the Server GitHub Appworkflow_name: An expected client workflow name. If the actual client workflow name is different from this input, the request is denied. The default value issecurefix. If this is empty, the workflow name is freepull_request_comment: A pull request comment template. A comment is posted if server actions fail to create a commit. The default value is:x: Securefix failed.config: YAML config to push other repositories and branches. Eitherconfigorconfig_fileis required if you want to change repositories and branches where commits are pushedconfig_file: A file path to YAML config to push other repositories and branches. Eitherconfigorconfig_fileis required if you want to change repositories and branches where commits are pushed
config and config_file are ignored if no repository or branch is set by the client action.
If a branch or repository is set, they are validated by config.
If there is no entry matching with source repository and branch and destination repository and branch.
About the configuration file, please see config.md.
💡 To improve the maintainability, we recommend config_file rather than config.
config:
- uses: csm-actions/securefix-action@latest
id: prepare
with:
action: prepare
app_id: ${{ vars.APP_ID }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
config: |
entries:
- client:
repositories:
- suzuki-shunsuke/tfaction
branches:
- main
push:
repositories:
- suzuki-shunsuke/tfaction-docs
branches:
- gh-pagesconfig_file:
- uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v6-beta
with:
persist-credentials: false
sparse-checkout: |
config.yaml
sparse-checkout-cone-mode: false
- uses: csm-actions/securefix-action@latest
id: prepare
with:
action: prepare
app_id: ${{ vars.AUTOFIX_APP_ID }}
app_private_key: ${{ secrets.AUTOFIX_APP_PRIVATE_KEY }}
config_file: config.yamlbranch: A branch where a commit is pushedclient_repository: A client repository's full namecreate_pull_request: Parameters to create a pull requestfixed_files: Fixed file paths. Paths are separated with newlinesgithub_token: A GitHub App installation access token to create a commit and a pull requestmetadata: A request's metadata. It's a JSON string.
{
"context": {
// github-script's context object
},
"inputs": {
"commit_message": "commit message"
}
}context is a github-script's context object.
pull_request: A pull request payload triggering a client workflow runpush_repository: A repository full name where a commit is pushedworkflow_run: A client Workflow Run Payload