Commit 0969496a authored by tom's avatar tom

label issues in pre-release only on initial tag run

parent 28ed53cc
...@@ -4,7 +4,7 @@ on: ...@@ -4,7 +4,7 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
tags: tags:
- 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+*' # e.g v1.2.3-alpha - 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+*' # e.g v1.2.3-alpha.2
jobs: jobs:
checks: checks:
...@@ -24,9 +24,29 @@ jobs: ...@@ -24,9 +24,29 @@ jobs:
uses: "./.github/workflows/e2e-tests.yml" uses: "./.github/workflows/e2e-tests.yml"
secrets: inherit secrets: inherit
version:
name: Pre-release version info
runs-on: ubuntu-latest
outputs:
is_initial: ${{ steps.is_initial.outputs.result }}
steps:
- name: Determine if it is the initial version of the pre-release
id: is_initial
uses: actions/github-script@v6
env:
TAG: ${{ github.ref_name }}
with:
script: |
const tag = process.env.TAG;
const REGEXP = /^v[0-9]+.[0-9]+.[0-9]+-[a-z]+((\.|-)\d+)?$/i;
const match = tag.match(REGEXP);
return match && !match[1] ? 'true' : 'false';
label_issues: label_issues:
name: Add pre-release label to issues name: Add pre-release label to issues
uses: './.github/workflows/label-issues-in-release.yml' uses: './.github/workflows/label-issues-in-release.yml'
needs: [ version ]
if: ${{ needs.version.outputs.is_initial == 'true' }}
with: with:
tag: ${{ github.ref_name }} tag: ${{ github.ref_name }}
label_name: 'pre-release' label_name: 'pre-release'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment