This commit is contained in:
16
.gitea/workflows/push_to_main.yaml
Normal file
16
.gitea/workflows/push_to_main.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
name: Push to main
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
Reset-Version-Tag:
|
||||
runs-on: debian-bullseye
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- run: git tag -d v1 || true
|
||||
- run: git push --delete origin v1 || true
|
||||
- run: git tag v1
|
||||
- run: git push --tags
|
||||
13
action.sh
Executable file
13
action.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
apt update
|
||||
apt install jq -y
|
||||
CURRENT_VERSION=$(jq -r .version package.json)
|
||||
echo $CURRENT_VERSION
|
||||
PREVIOUS_VERSIONS=$(git tag -l)
|
||||
echo $PREVIOUS_VERSIONS
|
||||
# yo
|
||||
|
||||
if [[ $PREVIOUS_VERSIONS == *$CURRENT_VERSION* ]];
|
||||
then
|
||||
echo "Version $CURRENT_VERSION already tagged in this repository. Be sure to update version number, or delete existing tag."
|
||||
return 1
|
||||
fi
|
||||
8
action.yaml
Normal file
8
action.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
name: version-tag
|
||||
description: "Creates a version tag when the 'version' value in 'package.json' has changed and a tag with the version number does not already exist."
|
||||
author: "Bryce Thorup"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- run: $GITHUB_ACTION_PATH/action.sh
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user