Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #50 from mesh-for-data/roee88-patch-1
Browse files Browse the repository at this point in the history
Create tag.yml
  • Loading branch information
roee88 authored Apr 26, 2021
2 parents daa3f03 + 2e60985 commit 8cb08e8
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create Tag

on:
workflow_dispatch:
inputs:
version:
description: 'Release tag'
required: true

jobs:
tag:
name: Create tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: 'Get previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Get possible next tags'
id: semvers
uses: "WyriHaximus/[email protected]"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: 'Verify input version'
if: github.event.inputs.version != steps.semvers.outputs.v_major && github.event.inputs.version != steps.semvers.outputs.v_minor && github.event.inputs.version != steps.semvers.outputs.v_patch
run: exit 1
- name: 'Create new tag'
if: success()
uses: actions/[email protected]
with:
github-token: ${{ secrets.TAG_PSAT }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ github.event.inputs.version }}",
sha: context.sha
})

0 comments on commit 8cb08e8

Please sign in to comment.