Skip to content

fix: Modal scrollbar overflow #5729

fix: Modal scrollbar overflow

fix: Modal scrollbar overflow #5729

name: check-pr-maintainer-access
# pull_request_target is safe here because this workflow never checks out
# the PR's code — it only reads PR metadata via GraphQL and posts a comment.
on:
pull_request_target: # zizmor: ignore[dangerous-triggers]
types:
- opened
permissions:
contents: read
jobs:
notify-when-maintainers-cannot-edit:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const query = `
query($number: Int!) {
repository(owner: "filamentphp", name: "filament") {
pullRequest(number: $number) {
headRepositoryOwner {
login
}
maintainerCanModify
}
}
}
`
const pullNumber = context.issue.number
const variables = { number: pullNumber }
try {
console.log(`Check #${pullNumber} for maintainer edit access...`)
const result = await github.graphql(query, variables)
console.log(JSON.stringify(result, null, 2))
const pullRequest = result.repository.pullRequest
if (pullRequest.headRepositoryOwner.login === 'filamentphp') {
console.log('PR owned by filamentphp')
return
}
if (! pullRequest.maintainerCanModify) {
console.log('PR not owned by filamentphp and does not have maintainer edits enabled')
await github.rest.issues.createComment({
issue_number: pullNumber,
owner: 'filamentphp',
repo: 'filament',
body: 'Thanks for submitting a PR!\n\nIn order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. If your fork belongs to a GitHub organization, please move the repository to your personal account and try again. If you\'re already using a personal fork, you can learn how to enable maintainer access [in the GitHub documentation](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork).'
})
await github.rest.issues.update({
issue_number: pullNumber,
owner: 'filamentphp',
repo: context.repo.repo,
state: 'closed'
})
}
} catch(error) {
console.log(error)
}