-
Notifications
You must be signed in to change notification settings - Fork 71
58 lines (50 loc) · 1.88 KB
/
create-tag.yml
File metadata and controls
58 lines (50 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Create tag"
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
inputs:
version:
description: 'Next version'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
jobs:
create-tag:
name: "Create tag"
runs-on: "ubuntu-latest"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Get next versions'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@d079934efaf011a4cf8912d4637097fe35d32b93" # v1
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: "Create new minor tag"
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2
if: inputs.version == 'minor'
with:
tag: ${{ steps.semvers.outputs.minor }}
message: ${{ steps.semvers.outputs.minor }}
- name: "Create new patch tag"
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2
if: inputs.version == 'patch'
with:
tag: ${{ steps.semvers.outputs.patch }}
message: ${{ steps.semvers.outputs.patch }}