Skip to content

[meta] add check pr translations workflow #5

[meta] add check pr translations workflow

[meta] add check pr translations workflow #5

Workflow file for this run

name: publish
on:
push:
branches:
- '**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
- name: Check commit messages
id: check_commit_messages
run: |
commits=$(git log ${{ github.event.before }}..${{ github.sha }} --pretty=format:'%s')
echo "Commits since last push:"
echo "$commits"
if echo "$commits" | grep -qE '^\[meta\]'; then
echo "Only meta commits present, skip publishing"
echo "run_publish=false" >> $GITHUB_ENV
else
echo "run_publish=true" >> $GITHUB_ENV
fi
- name: Build and publish to maven
if: env.run_publish == 'true'
uses: gradle/actions/setup-gradle@v3
with:
arguments: clean build publish curseforge modrinth --no-configuration-cache
env:
GIT_COMMIT: ${{ github.sha }}
GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}