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
ci: add branch input to Format Code workflow (#326)
Enables manual triggering of the Format Code workflow against any branch
via `workflow_dispatch` input.
## Changes
- **Added `branch` input**: Optional parameter in `workflow_dispatch`
trigger that accepts branch names
- **Updated checkout**: Uses `inputs.branch` when provided, falls back
to `github.ref` otherwise
- **Fixed branch detection**: Modified default branch check, format
commits step, and force push step to use the actual target branch (from
input or context)
## Behavior
```yaml
# Manual trigger via GitHub UI or API
inputs:
branch: 'feature/my-branch' # Optional - omit to use current branch
```
When `branch` is specified:
- Checks out the specified branch
- Validates it's not the default branch
- Formats all commits on that branch
- Force-pushes formatted commits back to the same branch
When omitted, maintains existing behavior using the triggered branch
context.
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Support passing a branch to the Format Code
workflow</issue_title>
> <issue_description>Add a branch input to the Format Code
`workflow_dispatch` workflow.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
- Fixes#325
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
0 commit comments