fix(check): properly fallback if no latest tag #40
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: CI | |
on: | |
workflow_dispatch: {} | |
push: {} | |
jobs: | |
check-only-last-has-last: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: cocogitto-action | |
- name: Initialise repository | |
run: | | |
git init | |
git config --global user.name 'Mona Lisa' | |
git config --global user.email '[email protected]' | |
echo 'cocogitto-action/' > .gitignore | |
echo '# Mona Lisa' > README.md | |
git add README.md .gitignore | |
git commit -m 'chore: add Mona Lisa docs' | |
git tag -m 'chore: 0.1.0' '0.1.0' | |
git commit --allow-empty -m 'feat: new cool feature' | |
- name: Run cocogitto-action | |
uses: ./cocogitto-action | |
with: | |
check: true | |
check-latest-tag-only: true | |
release: false | |
- run: | | |
git commit --allow-empty -m 'wrong commit format' | |
- name: Run cocogitto-action | |
uses: ./cocogitto-action | |
continue-on-error: true | |
with: | |
check: true | |
check-latest-tag-only: true | |
release: false | |
- name: Check outputs OK | |
if: ${{ success() }} | |
run: | | |
git log | |
- name: Check outputs KO | |
if: ${{ failure() }} | |
run: | | |
git log | |
# check-only-last-no-last: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# with: | |
# path: cocogitto-action | |
# - name: Initialise repository | |
# run: | | |
# git init | |
# git config --global user.name 'Mona Lisa' | |
# git config --global user.email '[email protected]' | |
# git commit --allow-empty -m 'feat: initial' | |
# git tag '0.1.0' | |
# echo 'cocogitto-action/' > .gitignore | |
# echo '# Mona Lisa' > README.md | |
# git add README.md .gitignore | |
# git commit -m 'chore: add Mona Lisa docs' | |
# - name: Run cocogitto-action | |
# id: release | |
# uses: ./cocogitto-action | |
# with: | |
# check: true | |
# check-latest-tag-only: true | |
# release: false | |
# - name: Check outputs | |
# run: | | |
# [ "${{ steps.release.outputs.version }}" == '0.1.0' ] || exit 1 | |
# [ -z "${{ steps.release.outputs.bumped }}" ] || exit 1 |