-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,68 @@ | ||
[![CI](https://github.com/tj-actions/release-tagger/workflows/CI/badge.svg)](https://github.com/tj-actions/release-tagger/actions?query=workflow%3ACI) | ||
[![Update release version.](https://github.com/tj-actions/release-tagger/workflows/Update%20release%20version./badge.svg)](https://github.com/tj-actions/release-tagger/actions?query=workflow%3A%22Update+release+version.%22) | ||
[![Public workflows that use this action.](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-tj-actions1.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Frelease-tagger%26badge%3Dtrue)](https://github.com/search?o=desc\&q=tj-actions+release-tagger+path%3A.github%2Fworkflows+language%3AYAML\&s=\&type=Code) | ||
[![Public workflows that use this action.](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-tj-actions1.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Frelease-tagger%26badge%3Dtrue)](https://github.com/search?o=desc&q=tj-actions+release-tagger+path%3A.github%2Fworkflows+language%3AYAML&s=&type=Code) | ||
|
||
|
||
## release-tagger | ||
|
||
Automatically manage action releases | ||
Automatically manage action release tags by ensuring that major release is always up to date. | ||
|
||
## Usage | ||
|
||
```yaml | ||
... | ||
name: Tag release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Create or update major release tag | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Action release tagger | ||
- name: Run release-tagger | ||
uses: tj-actions/release-tagger@v1 | ||
``` | ||
## Inputs | ||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section --> | ||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | | ||
|-------|--------|----------|-------------------------|--------------------------------------| | ||
| token | string | true | `"${{ github.token }}"` | GITHUB\_TOKEN or a Repo scoped<br>PAT | | ||
| Input | type | required | default | description | | ||
|:-------------:|:-----------:|:-------------:|:----------------------------:|:-------------:| | ||
| token | `string` | `true` | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) | | ||
|
||
<!-- AUTO-DOC-INPUT:END --> | ||
|
||
* Free software: [MIT license](LICENSE) | ||
* Free software: [MIT license](LICENSE) | ||
|
||
If you feel generous and want to show some extra appreciation: | ||
|
||
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee] | ||
|
||
[buymeacoffee]: https://www.buymeacoffee.com/jackton1 | ||
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png | ||
|
||
## Features | ||
|
||
* TODO | ||
|
||
## Credits | ||
Features | ||
-------- | ||
|
||
* TODO | ||
|
||
|
||
Credits | ||
------- | ||
|
||
This package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) using [cookiecutter-action](https://github.com/tj-actions/cookiecutter-action) | ||
|
||
## Report Bugs | ||
Report Bugs | ||
----------- | ||
|
||
Report bugs at https://github.com/tj-actions/release-tagger/issues. | ||
|
||
If you are reporting a bug, please include: | ||
|
||
* Your operating system name and version. | ||
* Any details about your workflow that might be helpful in troubleshooting. | ||
* Detailed steps to reproduce the bug. | ||
* Your operating system name and version. | ||
* Any details about your workflow that might be helpful in troubleshooting. | ||
* Detailed steps to reproduce the bug. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [[ $GITHUB_REF != "refs/tags/"* ]]; then | ||
echo "::warning::Skipping: This should only run on tags push or on release instead of '$GITHUB_EVENT_NAME'."; | ||
exit 0; | ||
fi | ||
|
||
git fetch origin +refs/tags/*:refs/tags/* | ||
|
||
NEW_TAG=${GITHUB_REF/refs\/tags\//} | ||
MAJOR_VERSION=$(echo "$NEW_TAG" | cut -d. -f1) | ||
|
||
# Re-tag the major version using the latest tag | ||
git tag -f "$MAJOR_VERSION" "$NEW_TAG" | ||
git push -f "$INPUTS_REMOTE" "$MAJOR_VERSION" | ||
|
||
echo "::set-output name=major_version::$MAJOR_VERSION" | ||
echo "::set-output name=new_version::$NEW_TAG" |