aRustyDev / aRustyDev/gh

feat(action): atomic-branch/create-branch - Create/update artifact branch

Open
#28 2 comments 0 reactions 1 assignee Claimed by @aRustyDev View on GitHub
enhancement new-action
Dominant language
Shell
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Parent Epic
Part of #22 (Atomic Release Pipeline Actions)

## Priority
P1 - Core W2 functionality

## Description

Create a composite action that creates or updates an artifact-specific branch.

For each changed artifact, creates a dedicated branch (e.g., `charts/my-chart`) containing only changes for that artifact.

## Inputs

| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `artifact` | Yes | - | Artifact name |
| `artifact-path` | Yes | - | Path to artifacts directory |
| `branch-prefix` | No | `` | Prefix for branch name |
| `target-branch` | No | `main` | Base branch for new branches |
| `source-sha` | No | `github.sha` | Commit SHA to copy artifact from |

## Outputs

| Output | Description |
|--------|-------------|
| `branch` | Full branch name (e.g., "charts/my-chart") |
| `updated` | "true" if branch was updated, "false" if no changes |
| `sha` | New branch HEAD SHA |

## Usage Example

```yaml
- uses: arustydev/gha/actions/atomic-branch/create-branch@v1
id: branch
with:
artifact: my-chart
artifact-path: charts
branch-prefix: charts
target-branch: main

- run: echo "Branch: ${{ steps.branch.outputs.branch }}"
```

## Source Reference

`gha/.github/workflows/atomic-release-atomize-changes.yml`:
- Create/update artifact branch step (lines 227-313)

## Implementation Notes

- Check if branch exists, fetch if so
- Skip if artifact content is already identical
- Use force-with-lease for safe pushes
- Implement retry logic for push failures

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.