Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjuly/tag-xyz
Create a new tag (x.y.z) based on the last one, and dispatch a relevant workflow if needed.
https://github.com/kjuly/tag-xyz
bump ci github-action increment tag version
Last synced: about 1 month ago
JSON representation
Create a new tag (x.y.z) based on the last one, and dispatch a relevant workflow if needed.
- Host: GitHub
- URL: https://github.com/kjuly/tag-xyz
- Owner: Kjuly
- License: mit
- Created: 2024-06-05T13:42:44.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-12T01:01:40.000Z (7 months ago)
- Last Synced: 2024-10-30T12:12:29.656Z (3 months ago)
- Topics: bump, ci, github-action, increment, tag, version
- Language: Shell
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tag XYZ
Create a new tag (x.y.z) based on the last one, and dispatch a relevant workflow if needed.## Usage
```yaml
on:
workflow_dispatch:schedule:
- cron: "0 12 * * 2"# See the "Workflow Permissions" section below for details.
permissions:
contents: write
actions: writejobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Create Tag for New Version
uses: kjuly/tag-xyz@main
with:
version_level: "z"
dispatch_workflow_id: "a_tag_trigged_workflow.yml"
```## Optional Inputs
| Input | Default | Description
| :--- | :--- | :---
| version_level | 'z' | The version level of 'x.y.z'.
| dispatch_workflow_id | '' | ID of the workflow to dispatch, e.g., 'test_workflow.yml'.## Workflow Permissions
Permissions setting is only needed if your repo has restricted permissions on the `GITHUB_TOKEN`.
In order to create a tag reference, we need the write permissions on `contents` & `actions`. Otherwise, we'll get a "Resource not accessible by integration" error when creating a tag ref using `github.rest.git.createRef` from `actions/github-script`.
You can confirm your repo's workflow permissions in
> Settings > Code and automation > Actions > General > Workflow permissions
It's "Read repository contents and packages permissions" by default. If it's "Read and write permissions", you can just remove the `permissions` setting in YAML file.
Further reading:
- [Modifying the permissions for the GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token)
- [Assigning permissions to jobs](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs)
- [Create a reference](https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#create-a-reference)