Skip to content

docs: replace the homepage with the reactnativepaper.com landing page #112

docs: replace the homepage with the reactnativepaper.com landing page

docs: replace the homepage with the reactnativepaper.com landing page #112

name: Contributor Label

Check warning on line 1 in .github/workflows/contributor-label.yml

View workflow run for this annotation

GitHub Actions / Contributor Label

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
on:
pull_request_target:
types: [opened, reopened]
permissions:
issues: write
jobs:
label:
name: Add contributor label
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
app-id: ${{ secrets.ORG_MEMBERSHIP_APP_ID }}
private-key: ${{ secrets.ORG_MEMBERSHIP_APP_PRIVATE_KEY }}
owner: callstack-internal
permission-members: read
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
ORG_MEMBERSHIP_TOKEN: ${{ steps.app-token.outputs.token }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const label = 'Contributor: Internal';
const pullRequest = context.payload.pull_request;
if (pullRequest.labels.some(({ name }) => name === label)) {
return;
}
const username = pullRequest.user.login;
const { data } =
await github.rest.repos.getCollaboratorPermissionLevel({
owner,
repo,
username,
});
let isInternal =
['MEMBER', 'OWNER'].includes(pullRequest.author_association) ||
['admin', 'maintain', 'write'].includes(data.permission);
if (!isInternal) {
try {
const internalGithub = getOctokit(process.env.ORG_MEMBERSHIP_TOKEN);
await internalGithub.rest.orgs.checkMembershipForUser({
org: 'callstack-internal',
username,
});
isInternal = true;
} catch (error) {
if (error.status !== 404) {
throw error;
}
}
}
if (!isInternal) {
return;
}
await github.rest.issues.addLabels({
owner,
repo,
issue_number: pullRequest.number,
labels: [label],
});