[WIP] workflows: add workflow to create snapshot tag #1
Workflow file for this run
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
name: Snapshot tag | |
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors | |
# SPDX-FileCopyrightText: 2024 STRATO AG | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
# Create snapshot tags for pushes to the main development branch | |
# This in turn triggers a release build. | |
on: | |
push: | |
branches: | |
# Enable once approved | |
# - ionos-dev | |
- tl/workflow-build-snapshots-with-releases | |
jobs: | |
snapshot-tag: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
name: snapshot-tag | |
steps: | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
# https://octokit.github.io/rest.js/v21/#git-create-tag | |
script: | | |
const { DIST_VERSION } = process.env; | |
const dateStr = new Date() | |
.toISOString() | |
.replace(/^(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+).*$/, "$1$2$3-$4$5$6"); | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
message: 'Snapshot', | |
ref: `refs/tags/snap-rel-${dateStr}`, | |
sha: context.sha | |
}); |