summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGoni Zahavy <[email protected]>2026-01-29 18:38:08 +0200
committerGitHub <[email protected]>2026-01-29 10:38:08 -0600
commitd5c59a66c11c6be38e6ec963315a1d425da530fc (patch)
tree0ee15fc8f9caf12311b23f174d825fa61279b463
parent301895c7f7da5241cbc3392024e26febf24644d8 (diff)
downloadopencode-d5c59a66c11c6be38e6ec963315a1d425da530fc.tar.gz
opencode-d5c59a66c11c6be38e6ec963315a1d425da530fc.zip
ci: added gh workflow that adds 'contributor' label to PRs/Issues (#11118)
Co-authored-by: Aiden Cline <[email protected]>
-rw-r--r--.github/workflows/contributors-label.yml33
1 files changed, 33 insertions, 0 deletions
diff --git a/.github/workflows/contributors-label.yml b/.github/workflows/contributors-label.yml
new file mode 100644
index 000000000..ac2214241
--- /dev/null
+++ b/.github/workflows/contributors-label.yml
@@ -0,0 +1,33 @@
+name: Add Contributors Label
+
+on:
+ # issues:
+ # types: [opened]
+
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ add-contributor-label:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ issues: write
+
+ steps:
+ - name: Add Contributor Label
+ uses: actions/github-script@v8
+ with:
+ script: |
+ const isPR = !!context.payload.pull_request;
+ const issueNumber = isPR ? context.payload.pull_request.number : context.payload.issue.number;
+ const authorAssociation = isPR ? context.payload.pull_request.author_association : context.payload.issue.author_association;
+
+ if (authorAssociation === 'CONTRIBUTOR') {
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: issueNumber,
+ labels: ['contributor']
+ });
+ }