Skip to content

Bump stefanzweifel/git-auto-commit-action from 4 to 5 #104

Bump stefanzweifel/git-auto-commit-action from 4 to 5

Bump stefanzweifel/git-auto-commit-action from 4 to 5 #104

Workflow file for this run

name: CI
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
jobs:
versioning:
if: ${{ !contains(github.event.head_commit.message, 'Tag new version') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.event_name == 'pull_request' && secrets.GITHUB_TOKEN || secrets.TAG_PAT_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "adopt"
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Bump version
id: compute_version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: fabricepipart1a
RELEASE_BRANCHES: main
DEFAULT_BRANCH: main
DEFAULT_BUMP: patch
DRY_RUN: true
- name: Build Maven and Docker
env:
VERSION: ${{ steps.compute_version.outputs.new_tag }}
run: |
mvn -B -U versions:set -DnewVersion=${VERSION} &> /dev/null
mvn -B -U clean verify
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.event_name != 'pull_request' }}
env:
VERSION: ${{ steps.compute_version.outputs.new_tag }}
with:
commit_message: Tag new version ${{ env.VERSION }}
file_pattern: 'pom.xml'
tagging_message: ${{ env.VERSION }}