Skip to content
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

feat: allow non-default target branch deployments via a new input option #361

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

GrantBirki
Copy link
Member

@GrantBirki GrantBirki commented Jan 22, 2025

About

This pull request does the following:

  • Adds allow_non_default_target_branch_deployments as a new input option. This new input option will allow pull requests that are targeting (merging into) a branch other than the default one (often main) to be deployed. This option is disabled by default as it is potentially unsafe since non-default branches usually lack adequate branch protection rules (or GitHub rulesets).
  • Adds non_default_target_branch_used as an output variable. This new output will indicate if a pull request is targeting a branch other than the default branch for the merge. If this is the case, then it will be set to "true".

Usage

- uses: github/[email protected]
  id: branch-deploy
  with:
    trigger: ".deploy"
    allow_non_default_target_branch_deployments: true # <-- allows deployments of pull requests that target a branch other than the default branch

If you also wish to disable the security warnings that come with this setting (due to its risky nature) you can also do so with:

- uses: github/[email protected]
  id: branch-deploy
  with:
    trigger: ".deploy"
    allow_non_default_target_branch_deployments: true
    use_security_warnings: false # <-- disables the security warnings in your logs that come with the 'allow_non_default_target_branch_deployments' option

related: #341, #340

@GrantBirki GrantBirki added the enhancement New feature or request label Jan 22, 2025
@GrantBirki GrantBirki self-assigned this Jan 22, 2025
@Copilot Copilot bot review requested due to automatic review settings January 22, 2025 20:00

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@GrantBirki GrantBirki merged commit c8417fc into main Jan 22, 2025
4 checks passed
@GrantBirki GrantBirki deleted the feat/allow_non_default_target_branch_deployments branch January 22, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant