Skip to content

Revenue chart: readable values, week/month/year views, year boundaries, history paging #161

Revenue chart: readable values, week/month/year views, year boundaries, history paging

Revenue chart: readable values, week/month/year views, year boundaries, history paging #161

name: PR Template Check
on:
pull_request:
types: [opened, edited, synchronize]
merge_group:
jobs:
check-template:
runs-on: ubuntu-latest
steps:
- name: Verify PR body contains Checklist section
uses: actions/github-script@v7
with:
script: |
if (context.eventName === 'merge_group') {
core.info('Merge group event — template already checked on the PR');
return;
}
const author = context.payload.pull_request.user.login;
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: author,
}).catch(() => ({ data: null }));
const level = perm?.permission;
core.info(`PR author: ${author}, repo permission: ${level}`);
if (level === 'admin' || level === 'write') {
core.info(`Skipping checklist check for repo ${level}`);
return;
}
const body = context.payload.pull_request.body || '';
if (!body.includes('## Checklist')) {
core.setFailed(
'PR body is missing the "## Checklist" section. ' +
'Please use the PR template when opening a pull request.'
);
}