-
Notifications
You must be signed in to change notification settings - Fork 0
feat: support pushing a commit to other repository and branch #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` Error: The template is not valid. csm-actions/securefix-action/pr/123/server/prepare/action.yaml (Line: 50, Col: 12): Error reading JToken from JsonReader. Path '', line 0, ```
21 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request enables this action to change the repository and branch where a commit is pushed.
And it also enables this action to create a pull request.
Why?
By default, Securefix Action pushes a commit to the repository and branch where the action is run.
But actually there are usecases that you want to push a commit to other repository and branch.
workflow_dispatch
Security
Allowing to push any repository and branch without any restriction is dangerous, so by default changing the repository and branch isn't allowed, meaning it the action fails.
You can change the repository and branch only if they are allowed.
Additional Permissions of the server app are required if some inputs are given.
issues:write
: This is required if the inputpull_request_labels
is setmembers:read
: This is required if the inputpull_request_team_reviewers
is setHow to use
issues:write
andmembers:read
)config
orconfig_file
tocsm-actions/securefix-action/server/prepare
in the server workflow:💡 To improve the maintainability, it's good to manage config in a dedicated file and read it from action.
e.g.
e.g.
New Inputs and Outputs of actions
All of them are optional.
csm-actions/securefix-action
repository
orbranch
is required if you want to change them.repository
: A repository full name where a commit will be pushed. By default, this is$GITHUB_REPOSITORY
branch
: A branch where a commit will be pushed. By default, this is a branch where the action is run--
pull_request_title
andpull_request_base_branch
are required if you want to create a pull request.pull_request_title
: A pull request titlepull_request_body
: A pull request descriptionpull_request_labels
: Pull request labels. This requiresissues:write
permissionpull_request_draft
: If true, create a pull request as draftpull_request_reviewers
: Pull request reviewerspull_request_team_reviewers
: Pull request team reviewers. This requires themembers:read
permissionpull_request_assignees
: Pull request assigneespull_request_comment
: Pull request comment--
fail_if_changes
: If true, the action fails if there are changesBy default, the client action fails if any files are changed, but if a commit is pushed to the other repository or branch, the action succeeds.
If
fail_if_changes
istrue
, the client action fails if any files are changed.If
fail_if_changes
isfalse
, the client action succeeds even if any files are changed.csm-actions/securefix-action/server/prepare
Either
config
orconfig_file
is required to change the repository and branch.config
: YAML config to push other repositories and branchesconfig_file
: A file path to YAML configconfig is ignored if no repository or branch is set by the client action.
If branch or repository is set, they are validated config.
If there is no entry matching with source repository and branch and destination repository and branch.