-
Notifications
You must be signed in to change notification settings - Fork 8
28 lines (26 loc) · 901 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
name: tag
on:
push: {branches: [master]}
jobs:
tag:
name: tag
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- id: var
run: |
version="$(sed -E 's#black==(.*)#\1#g' ./requirements.txt)"
create_tag="$(git ls-remote --exit-code origin "refs/tags/$version" >/dev/null && echo false || echo true)"
echo "version=$version" >>$GITHUB_OUTPUT
echo "create_tag=$create_tag" >>$GITHUB_OUTPUT
- name: tag
if: steps.var.outputs.create_tag == 'true'
env:
VERSION: ${{ steps.var.outputs.version }}
run: |
git config --global user.name 'jacobi petrucciani'
git config --global user.email '[email protected]'
git tag -a "$VERSION" -m "$VERSION"
git push --tags