Skip to content

- Create tag now

- Create tag now #11

---
# SPDX-FileCopyrightText: (c) 2025 ale5000
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Create tag now"
permissions: {}
on:
workflow_dispatch:
jobs:
tag-creation:
name: "Tag creation"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout sources"
uses: actions/checkout@v4
- name: Parse version
id: "repo-info"
run: |
# Parsing version...
version="$(grep -m 1 -e '^version=' -- 'zip-content/module.prop' | cut -d '=' -f '2-' -s)" || exit "${?}"
printf 'version=%s\n' "${version:-Empty}" >> "${GITHUB_OUTPUT?}"
- name: "Create tag"
uses: actions/github-script@v7
with:
script: |
console.log('::notice::Tag: ${{ steps.repo-info.outputs.version }}')
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.repo-info.outputs.version }}',
sha: context.sha
}).catch(error => {
console.log(error.message)
if(error.status == 422) {
console.log('::warning::Tag already exist, ignored!!!')
return
}
console.log('::error::Tag creation failed with error ' + error.status)
console.log('')
console.log('DEBUG:')
throw error
})