Difference between revisions of "Github Actions Repo Security Options"
Jump to navigation
Jump to search
(Created page with "``` name: Restrict Pull Requests on: pull_request: types: [opened, synchronize] jobs: restrict-pr: runs-on: ubuntu-latest steps: - name: Check PR Autho...") |
(No difference)
|
Revision as of 19:15, 1 October 2024
name: Restrict Pull Requests
on:
pull_request:
types: [opened, synchronize]
jobs:
restrict-pr:
runs-on: ubuntu-latest
steps:
- name: Check PR Author
id: check-author
run: |
ALLOWED_USERS=("user1" "user2" "user3")
PR_AUTHOR=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
if [[ ! " ${ALLOWED_USERS[@]} " =~ " ${PR_AUTHOR} " ]]; then
echo "This user is not allowed to create pull requests."
exit 1
fi