Skip to content

Automatic get latest tag #13

Automatic get latest tag

Automatic get latest tag #13

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 "[email protected]"
git config --local user.name "yangchuansheng"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git tag ${{ steps.tag.outputs.tag }}
git push origin --tags