-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.13 KB
/
autotag.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
name: Check and create tag
on:
push:
branches:
- master
paths:
- vscapi/_metadata.py
jobs:
new_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version number
run: |
echo "CURR_VER=v$(python -c "import runpy;runpy.run_path('vscapi/_metadata.py', None, '__github__')")" >> $GITHUB_ENV
- name: Check if version exists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: mukunku/[email protected]
id: tagcheck
with:
tag: ${{ env.CURR_VER }}
- name: Make tag
uses: actions/github-script@v3
if: steps.tagcheck.outputs.exists == 'false'
with:
github-token: ${{ secrets.WORKFLOW_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${process.env.CURR_VER}`,
sha: context.sha
})
- name: Fallback
if: steps.tagcheck.outputs.exists == 'true'
run: echo "Nothing to see here, move along citizen"