Skip to content

Fix version for initial PR if not tag exists #119

Fix version for initial PR if not tag exists

Fix version for initial PR if not tag exists #119

name: CI
on:
push:
branches:
- master
paths-ignore:
- '.github/**'
pull_request:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
- name: Run tests
run: |
sudo apt-get install -y bats
./test.sh
- uses: ./versioner/
id: versioner
- name: publish tag
if: ${{ github.ref == 'refs/heads/master' }}
run: |
git config --global user.email ${{ secrets.EMAIL }}
git config --global user.name ${{ secrets.NAME }}
git tag -a ${{ steps.versioner.outputs.version }} -m ${{ steps.versioner.outputs.version }}
git push --tags