Skip to content

Automatic get latest tag #8

Automatic get latest tag

Automatic get latest tag #8

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 --global user.email "[email protected]"
git config --global user.name "yangchuansheng"
git remote set-url origin https://x-access-token:${{ secrets.GIT_TOKEN }}@github.com/yangchuansheng/anki-sync-server.git
git tag ${{ steps.tag.outputs.tag }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GIT_TOKEN }}
force: true
tags: true