-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I've read the note in the documentation:
You must already have 2 tags in your repository (1 previous tag + the current latest tag triggering the job). The job will exit with an error if it can't find the previous tag!
My question is how to prevent the workflow failing caused when no previous tag exists. I think that this should be documented too, at least with some code snippers. Because on a brand new project, this is going to 100% fail for obvious reasons.
Of course one can:
- Create the first tag and push it
- Manually create a the first release based on the tag above
- Add the workflow
... but this is very incovenient.
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
makeLatest: true
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'chore(docs): Update CHANGELOG.md for ${{ github.ref_name }} [ci skip]'
file_pattern: CHANGELOG.md
martibosch
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request