mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-15 06:33:17 +08:00
chore: Add workflow
This commit is contained in:
parent
1e0de0fccd
commit
b8c0499d1e
24
.github/workflows/update-major-tag.yml
vendored
Normal file
24
.github/workflows/update-major-tag.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: Update major tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Update major tag
|
||||||
|
if: github.event.release.prerelease == false
|
||||||
|
run: |
|
||||||
|
git config user.name "${GITHUB_ACTOR}"
|
||||||
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||||
|
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
export TAG_NAME="${GITHUB_REF##refs/tags/}"
|
||||||
|
export TAG_MAJOR="${TAG_NAME%%.*}"
|
||||||
|
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || git tag -d "${TAG_MAJOR}" ; git push --delete origin "${TAG_MAJOR}"
|
||||||
|
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || true
|
||||||
|
git push origin "${TAG_MAJOR}"
|
Loading…
x
Reference in New Issue
Block a user