deps(actions): bump the gh-actions group across 1 directory with 4 updates #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Validation | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| validate: | |
| name: Validate PR | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 | |
| - name: Check PR title format | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| if ! echo "$PR_TITLE" | grep -qE "^(feat|fix|docs|test|refactor|perf|chore|ci|build|style):"; then | |
| echo "::error::PR title must start with a conventional commit type" | |
| echo "Expected format: type: description" | |
| echo "Valid types: feat, fix, docs, test, refactor, perf, chore, ci, build, style" | |
| exit 1 | |
| fi | |
| echo "✅ PR title format is valid" | |
| - name: Check for breaking changes | |
| id: breaking | |
| env: | |
| BASE_REF: ${{ github.event.pull_request.base.ref }} | |
| run: | | |
| BREAKING_FILES=$(git diff "origin/${BASE_REF}...HEAD" --name-only | grep -E "modules/contracts/.*Contract\.scala|modules/core/.*Contract\.scala" || true) | |
| if [ -n "$BREAKING_FILES" ]; then | |
| echo "breaking=true" >> "$GITHUB_OUTPUT" | |
| echo "⚠️ Contract changes detected in:" | |
| echo "$BREAKING_FILES" | |
| else | |
| echo "breaking=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Comment on breaking changes | |
| if: steps.breaking.outputs.breaking == 'true' | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '⚠️ **Breaking Change Detection**\n\nThis PR modifies contract files. Please ensure:\n- [ ] Backwards compatibility is maintained\n- [ ] Migration guide is provided\n- [ ] Version bump is appropriate\n- [ ] Compile-time contract tests pass' | |
| }) | |
| - name: Check PR size | |
| run: | | |
| ADDITIONS=$(jq -r '.pull_request.additions' "$GITHUB_EVENT_PATH") | |
| DELETIONS=$(jq -r '.pull_request.deletions' "$GITHUB_EVENT_PATH") | |
| TOTAL=$((ADDITIONS + DELETIONS)) | |
| if [ "$TOTAL" -gt 1000 ]; then | |
| echo "::warning::Large PR detected ($TOTAL lines changed). Consider splitting into smaller PRs." | |
| fi | |
| echo "✅ PR size: $TOTAL lines changed" |