- Create tag now #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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 | |
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: | | |
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('Tag creation failed with error ' + error.status) | |
console.log(error.message) | |
console.log('') | |
console.log('DEBUG:') | |
throw error; | |
}) |