Skip to content

feat(devops): add actions #1

feat(devops): add actions

feat(devops): add actions #1

Workflow file for this run

name: PR Watcher
on:
pull_request:
types: [opened, synchronize]
jobs:
check-pr-size:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/github-script@v7
with:
script: |
const MAX_PR_SIZE = parseInt(process.env.MAX_PR_SIZE);
const pr = context.payload.pull_request;
if (pr.additions > MAX_PR_SIZE) {
github.rest.issues.createComment({
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `:x: PR size is too large. Please keep PR size under ${MAX_PR_SIZE} additions.`
});
core.setFailed(`PR size is too large. Please keep PR size under ${MAX_PR_SIZE} additions.`);
} else { core.notice(`PR size is within limits.`); }
env:
MAX_PR_SIZE: 50