Skip to content

Commit

Permalink
Rename next-image-tag-number, update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
lnhrdt committed Nov 9, 2024
1 parent dec28b9 commit e60e1ae
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 7 deletions.
2 changes: 1 addition & 1 deletion load-env/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# load-env Github Action
# load-env GitHub Action

The **load-env** action provides .env key-value pairs as outputs for use in workflows.

Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions next-image-tag-number/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# next-image-tag-number GitHub Action

The **next-image-tag-number** action calculates the next sequential tag for an image in an OCI repository. This is useful for tracking build numbers or versioning images in continuous integration workflows.

## Usage

Specify the OCI image repository URL in your workflow, along with optional parameters:

```yaml
jobs:
next-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get Next Image Tag Number
id: next-tag
uses: codebandits/github-actions/next-image-tag-number@main
with:
image_repository_url: https://registry.example.com/v2/my-repo/my-image
bearer_token: ${{ secrets.REPO_BEARER_TOKEN }}
initial_number: 100
tag_prefix: build-

- run: echo "Next tag is ${{ steps.next-tag.outputs.tag }} with number ${{ steps.next-tag.outputs.number }}"
```
## Inputs
- `image_repository_url:` **Required.** The URL of the OCI-compatible image repository.
- `bearer_token:` Optional. The bearer token for repository authentication. Defaults to empty (no authentication).
- `initial_number:` Optional. Starting tag number if no tags exist in the repository. Defaults to 1.
- `tag_prefix:` Optional. Prefix for the tags. Defaults to build-.

## Outputs

- `tag:` The next tag, including the prefix and tag number.
- `number:` The next tag number.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Next Repository Tag Number
description: Get the next tag number for a repository.
name: Next Image Tag Number
description: Get the next tag number for an image in an OCI repository.

inputs:
repository_url:
description: The URL of the OCI-compatible repository.
image_repository_url:
description: The URL of the OCI-compatible image repository.
required: true
bearer_token:
description: Optional bearer token for repository authentication.
Expand All @@ -19,7 +19,7 @@ inputs:

outputs:
tag:
description: The next tag.
description: The next tag, including the prefix and tag number.
value: ${{ steps.next-tag.outputs.tag }}
number:
description: The next tag number.
Expand All @@ -29,7 +29,7 @@ runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.repository_url }}
- ${{ inputs.image_repository_url }}
- ${{ inputs.bearer_token }}
- ${{ inputs.initial_number }}
- ${{ inputs.tag_prefix }}

0 comments on commit e60e1ae

Please sign in to comment.