5 changed files with 53 additions and 18 deletions
@ -1,16 +0,0 @@ |
|||||
name: Enforce Develop Branch |
|
||||
on: |
|
||||
pull_request: |
|
||||
branches: |
|
||||
- master # Triggers only on PRs targeting master |
|
||||
|
|
||||
jobs: |
|
||||
guard-master: |
|
||||
runs-on: ubuntu-latest |
|
||||
steps: |
|
||||
- name: Check base branch |
|
||||
# logic: If the PR is NOT coming from a release or hotfix branch, block it. |
|
||||
if: "!startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/')" |
|
||||
run: | |
|
||||
echo "::error::⛔ WRONG BRANCH: You are trying to merge into 'master'. Please change the base branch of this PR to 'develop'." |
|
||||
exit 1 |
|
||||
@ -0,0 +1,29 @@ |
|||||
|
name: Update Documentation |
||||
|
|
||||
|
on: |
||||
|
pull_request: |
||||
|
types: [closed] |
||||
|
branches: [master] |
||||
|
|
||||
|
jobs: |
||||
|
update-docs: |
||||
|
# Only run if PR was merged (not just closed) |
||||
|
if: github.event.pull_request.merged == true |
||||
|
runs-on: ubuntu-latest |
||||
|
|
||||
|
steps: |
||||
|
- name: Trigger docs update |
||||
|
uses: peter-evans/repository-dispatch@v3 |
||||
|
with: |
||||
|
token: ${{ secrets.DOCS_REPO_PAT }} |
||||
|
repository: shrimbly/node-banana-docs |
||||
|
event-type: source-pr-merged |
||||
|
client-payload: | |
||||
|
{ |
||||
|
"pr_number": "${{ github.event.pull_request.number }}", |
||||
|
"pr_title": "${{ github.event.pull_request.title }}", |
||||
|
"pr_body": ${{ toJson(github.event.pull_request.body) }}, |
||||
|
"pr_url": "${{ github.event.pull_request.html_url }}", |
||||
|
"merged_by": "${{ github.event.pull_request.merged_by.login }}", |
||||
|
"head_sha": "${{ github.event.pull_request.merge_commit_sha }}" |
||||
|
} |
||||
Loading…
Reference in new issue