-
Notifications
You must be signed in to change notification settings - Fork 14
36 lines (33 loc) · 1.3 KB
/
pr-dispatch.yml
File metadata and controls
36 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: PR dispatch
on:
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]
branches: ['main', 'master']
workflow_call:
# concurrency:
# group: dispatch-${{ github.event.pull_request.number || github.sha }}
# cancel-in-progress: true
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Check "Allow edits from maintainers" setting
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
if [ "${{ github.event.pull_request.maintainer_can_modify }}" = "true" ]; then
echo "✅ PR is from a fork and 'Allow edits from maintainers' is ENABLED."
else
echo "⚠️ PR is from a fork and 'Allow edits from maintainers' is DISABLED."
echo "ℹ️ Automated changes will fail. Enable the checkbox in the PR UI to allow CI to push changes."
fi
pr-internal:
uses: ./.github/workflows/pr-internal.yml
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
needs: dispatch
secrets: inherit
pr-external:
uses: ./.github/workflows/pr-external.yml
if: github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
needs: dispatch
secrets: inherit