Skip to content

ci: add assignee to a PR #1185

ci: add assignee to a PR

ci: add assignee to a PR #1185

name: PR Validations
on:
merge_group:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
typos:
name: Spell check PR title
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Store PR title in a file
shell: bash
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo $TITLE > pr_title.txt
- name: Spell check
uses: crate-ci/typos@master
with:
files: ./pr_title.txt
check-assignee:
name: Check Assignee
runs-on: ubuntu-latest
steps:
- name: Check if assignee is added
uses: actions/github-script@v6
with:
script: |
const assignees = context.payload.issue ? context.payload.issue.assignees : context.payload.pull_request.assignees;
console.log("Assignees:", assignees);
if (assignees.length === 0) {
throw new Error('No assignee added. Please add an assignee to this issue or pull request.');
} else {
console.log("Assignee check passed.");
}