-
Notifications
You must be signed in to change notification settings - Fork 10
42 lines (34 loc) · 892 Bytes
/
tag.yml
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
name: tag
on:
# Update tags on every push to main.
push:
branches:
- main
# To allow for manual testing.
workflow_dispatch:
jobs:
tag:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Tag new versions
shell: bash
run: |
set -e
commits=$(git log --pretty=format:"%h" ./VERSION)
for commit in $commits; do
version=$(git show $commit:./VERSION)
if [ -n "$(git tag -l "v${version}")" ]; then
continue
fi
echo "Tagging $commit as v${version}"
git tag "v${version}" $commit
done
- name: Push new tags
shell: bash
run: git push --tags