Draft release triggered from branch 'main' by @chances #14
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: Draft Releases | |
run-name: Draft release triggered from ${{ github.ref_type }} '${{ github.ref_name }}' by @${{ github.actor }} | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, reopened, synchronize] | |
# Required to support PRs from forks | |
pull_request_target: | |
types: [opened, reopened, synchronize] | |
jobs: | |
update-draft-release: | |
runs-on: ubuntu-latest | |
permissions: | |
# Required to create a GitHub release | |
contents: write | |
# Read permission is required for autolabeler | |
pull-requests: read | |
steps: | |
- name: Resolve an appropriate version tag | |
id: version | |
run: | | |
TAG_NAME=$(git describe --tags HEAD --abbrev=0 2>/dev/null || echo "v0.1.0") | |
echo "Resolved version: $TAG_NAME" | |
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT | |
- name: Update Release Draft | |
uses: release-drafter/release-drafter@v5.25.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# Name of the created or updated GitHub release. | |
# Overrides `name-template` specified in `release-drafter.yml`. | |
name: ${{ steps.version.outputs.TAG_NAME }} | |
# The tag name assigned to the created or updated GitHub release. | |
# Overrides `tag-template` specified in `release-drafter.yml`. | |
tag: ${{ steps.version.outputs.TAG_NAME }} | |
# The version to be associated with the GitHub release that's created or updated. | |
# Overrides any version calculated by the release-drafter. | |
version: ${{ steps.version.outputs.TAG_NAME }} | |
publish: false | |
commitish: ${{ github.sha }} | |
prerelease: ${{ startsWith(steps.version.outputs.TAG_NAME, 'v0.') }} | |
# Semantic identifier (alpha, beta, rc, etc.) to increment for prerelease versions. | |
prerelease-identifier: 'rc' |