Skip to content

Feature: setup base plugin #29

Feature: setup base plugin

Feature: setup base plugin #29

name: Default check for plugin pull-request
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
delete-comments:
name: Delete bot comment(s)
runs-on: ubuntu-latest
steps:
- uses: izhangzhihao/delete-comment@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_user_name: github-actions[bot]
issue_number: ${{ github.event.number }}
branch-naming-rules:
name: Check branch name
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/action-branch-name@master
with:
regex: '^(feature|bugfix|improvement|library||hotfix)\/[a-z0-9_.-]+$'
allowed_prefixes: 'feature,bugfix,improvement,library,hotfix'
ignore: main
min_length: 5
max_length: 50
commit-message-check:
name: Commit message check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Check commit message with semantic-version plugin
run: mvn -ntp io.github.zorin95670:semantic-version:0.4.0:check-commit -DnoMerge=true
detect-plugins:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get modified plugins
id: set-matrix
run: |
echo "🔍 Detecting modified plugins..."
PLUGINS=$(git log -1 --pretty=format:%B \
| grep -oP '(?<=\().+?(?=\))' \
| sort -u \
| grep -v '^template-plugin$' \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "matrix=${PLUGINS}"
echo "matrix=${PLUGINS}" >> $GITHUB_OUTPUT
checkstyle:
name: Code style - ${{ matrix.plugin }}
needs: detect-plugins
runs-on: ubuntu-latest
strategy:
matrix:
plugin: ${{ fromJson(needs.detect-plugins.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Run checkstyle on plugin
run: |
cd ${{ matrix.plugin }}
mvn -ntp checkstyle:check