Skip to content

Commit a734c6d

Browse files
Add workflow to get latest tag
Signed-off-by: Carson Yang <[email protected]>
1 parent cbf473a commit a734c6d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/get_latest_tag.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Automatic get latest tag
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "11 0 * * *"
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
name: Get latest tag
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Anki
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
repository: ankitects/anki
22+
- name: Get latest tag
23+
id: tag
24+
run: echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> "$GITHUB_OUTPUT"
25+
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.head_ref }}
30+
fetch-depth: 0
31+
- name: Add tag
32+
run: |
33+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
34+
git config --local user.name "github-actions[bot]"
35+
git tag ${{ steps.tag.outputs.tag }}
36+
git push origin --tags

0 commit comments

Comments
 (0)