Skip to content

Automatic get latest tag #12

Automatic get latest tag

Automatic get latest tag #12

name: Automatic get latest tag
on:
workflow_dispatch:
schedule:
- cron: "11 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Get latest tag
runs-on: ubuntu-latest
steps:
- name: Checkout Anki
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ankitects/anki
- name: Get latest tag
id: tag
run: echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Add tag
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag ${{ steps.tag.outputs.tag }}
git push origin --tags