Skip to content

Implement dual licensing model (AGPL-3.0 + Commercial) #49

Implement dual licensing model (AGPL-3.0 + Commercial)

Implement dual licensing model (AGPL-3.0 + Commercial) #49

---
name: Required Status Checks
on:
pull_request:
jobs:
# Detect what changes were made to determine which checks to run
detect-changes:
name: Detect changes
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
project: ${{ steps.filter.outputs.project }}
github-actions: ${{ steps.filter.outputs.github-actions }}
steps:
- uses: actions/checkout@v4
- name: Detect changes using paths filter
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
project:
- '**/*.versions.toml'
- '*.gradle.*'
- 'src/**'
github-actions:
- '.github/**'
# Always run commitlint
commitlint:
name: Conventional Commits check
permissions:
contents: read
uses: ./.github/workflows/commitlint.yml
# Run actionlint only if GitHub Actions files changed
actionlint:
name: Github Workflows check
needs: detect-changes
if: needs.detect-changes.outputs.github-actions == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: actionlint
uses: raven-actions/actionlint@v2
with:
shellcheck: false
# Run main gradle check if needed
project-check:
name: Project check
needs: detect-changes
if: needs.detect-changes.outputs.project == 'true'
permissions:
contents: read
uses: ./.github/workflows/check.yml
# Final status check - always runs and reports overall success/failure
required-checks-result:
runs-on: ubuntu-latest
needs: [detect-changes, commitlint, actionlint, project-check]
if: always()
permissions: {}
steps:
- name: Report final status
run: |
echo "=== Required Status Checks Summary ==="
# Always check commitlint
if [ "${{ needs.commitlint.result }}" != "success" ]; then
echo "❌ Commitlint failed"
exit 1
else
echo "✅ Commitlint passed"
fi
# Check actionlint if it was needed
if [ "${{ needs.detect-changes.outputs.github-actions }}" == "true" ]; then
if [ "${{ needs.actionlint.result }}" != "success" ]; then
echo "❌ Actionlint failed"
exit 1
else
echo "✅ Actionlint passed"
fi
else
echo "⏭️ Actionlint skipped (no GitHub Actions changes)"
fi
# Check project if it was needed
if [ "${{ needs.detect-changes.outputs.project }}" == "true" ]; then
if [ "${{ needs.project-check.result }}" != "success" ]; then
echo "❌ Project check failed"
exit 1
else
echo "✅ Project check passed"
fi
else
echo "⏭️ Project check skipped (no relevant changes)"
fi
echo "🎉 All required checks passed!"