Skip to content

Commit

Permalink
ci: auto mark pr from forks as community (#105)
Browse files Browse the repository at this point in the history
Closes #101

**Proposed Changes**
- created the job in pr-labels.yml
- updated the guidelines in pull_request_template.md


I submit this contribution under the Apache-2.0 license.
  • Loading branch information
tcdsv authored Jun 25, 2023
1 parent ac4f75a commit 30f954c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!--
Thanks for contributing to 2ms by offering a pull request.
Please add a "community" tag if you're an external contributor.
-->

Closes #
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Labels

on:
pull_request_target:
types: [opened]

jobs:
mark_as_community:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Mark as Community if PR is from a fork
if: github.event.pull_request.head.repo.full_name != github.repository
uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Community']
})

0 comments on commit 30f954c

Please sign in to comment.