Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/label-preview-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Label Preview Pull Requests

on:
pull_request_target:
types: [opened]
branches: [preview]

permissions:
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Add preview labels
uses: actions/github-script@v7
with:
script: |
const authorAssociation = context.payload.pull_request.author_association;
const labels = ['preview'];

if (['MEMBER', 'OWNER'].includes(authorAssociation)) {
labels.push('gsd:50917');
}
Comment on lines +23 to +25

@frandiox frandiox Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nicer to check the team instead of the org, but that requires another token with extra permissions


await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels,
});
Loading