Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
- name: Create Release PR
uses: stacklok/releaseo@v1
with:
releaseo_version: v1.0.0
bump_type: ${{ inputs.bump_type }}
token: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -81,6 +82,7 @@ jobs:
- name: Create Release PR
uses: stacklok/releaseo@v1
with:
releaseo_version: v1.0.0
bump_type: ${{ inputs.bump_type }}
token: ${{ secrets.GITHUB_TOKEN }}
version_files: |
Expand All @@ -107,6 +109,7 @@ jobs:
- name: Create Release PR
uses: stacklok/releaseo@v1
with:
releaseo_version: v1.0.0
bump_type: ${{ inputs.bump_type }}
token: ${{ secrets.GITHUB_TOKEN }}
version_files: |
Expand All @@ -124,6 +127,7 @@ jobs:
id: release
uses: stacklok/releaseo@v1
with:
releaseo_version: v1.0.0
bump_type: ${{ inputs.bump_type }}
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -138,6 +142,7 @@ jobs:

| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `releaseo_version` | Version of releaseo to use (e.g., `v1.0.0`) | Yes | - |
| `bump_type` | Version bump type (`major`, `minor`, `patch`) | Yes | - |
| `version_file` | Path to VERSION file | No | `VERSION` |
| `version_files` | YAML list of files with paths to update (see below) | No | - |
Expand Down
25 changes: 14 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ branding:
color: 'blue'

inputs:
releaseo_version:
description: 'Version of releaseo to use (e.g., v1.0.0). Must match a GitHub release.'
required: true
bump_type:
description: 'Version bump type (major, minor, patch)'
required: true
Expand Down Expand Up @@ -54,23 +57,24 @@ outputs:
runs:
using: 'composite'
steps:
- name: Download releaseo binary
id: download
- name: Validate version input
shell: bash
run: |
VERSION="${{ github.action_ref }}"

# Validate version is specified and is a tag (not a branch)
VERSION="${{ inputs.releaseo_version }}"
if [ -z "$VERSION" ]; then
echo "::error::No version specified. Please reference this action with a version tag (e.g., @v1.0.0)"
echo "::error::The 'releaseo_version' input is required. Please specify the releaseo version (e.g., v1.0.0)"
exit 1
fi

if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "::error::Invalid version '$VERSION'. Please use a semantic version tag (e.g., @v1.0.0). Using @main or @branch-name is not supported."
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Invalid version format '$VERSION'. Please use semantic versioning (e.g., v1.0.0)"
exit 1
fi

- name: Download releaseo binary
shell: bash
run: |
VERSION="${{ inputs.releaseo_version }}"

# Determine OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
Expand All @@ -85,10 +89,9 @@ runs:
ASSET_URL="https://github.com/stacklok/releaseo/releases/download/${VERSION}/${ASSET_NAME}"

echo "Downloading releaseo ${VERSION} for ${OS}/${ARCH}..."
echo "URL: ${ASSET_URL}"

if ! curl -sSL --fail -o releaseo.tar.gz "$ASSET_URL"; then
echo "::error::Failed to download releaseo ${VERSION}. Make sure the release exists at: https://github.com/stacklok/releaseo/releases/tag/${VERSION}"
echo "::error::Failed to download releaseo ${VERSION}. Ensure the release exists: https://github.com/stacklok/releaseo/releases/tag/${VERSION}"
exit 1
fi

Expand Down