Skip to content

Fixes #67

Fixes #67 #1

Workflow file for this run

name: Label Pull Request Based on Selection
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Apply label based on PR template selection
uses: actions/github-script@v6
with:
script: |
const pr = context.payload.pull_request;
const labelsToAdd = [];
if (pr.body.includes('- [ ] GSSOC')) {
labelsToAdd.push('gssoc');
}
if (labelsToAdd.length > 0) {
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: labelsToAdd
});
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}