-
-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (29 loc) · 914 Bytes
/
echo-tag.yml
File metadata and controls
34 lines (29 loc) · 914 Bytes
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
name: Echo Tag Name
on:
push:
branches:
- auto-sync-sandbox # Trigger on push to auto-sync-sandbox
tags:
- '*' # Trigger on any tag push
release:
types:
- published # Trigger when a release is published
branches:
- auto-sync-sandbox # Only for releases from auto-sync-sandbox
workflow_dispatch: # Manual trigger
branches:
- auto-sync-sandbox # Only from auto-sync-sandbox branch
jobs:
echo_tag:
runs-on: ubuntu-latest
steps:
- name: Echo the Tag Name
run: |
# Check if the workflow was triggered by a tag push or a release
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
# Extract the tag name from the GITHUB_REF variable
TAG_NAME="${GITHUB_REF##*/}"
echo "The tag name is: $TAG_NAME"
else
echo "Not triggered by a tag, skipping..."
fi