Files
MagicMirror/.github/workflows/enforce-pullrequest-rules.yaml
Kristjan ESPERANTO 32aa5c8721 chore: add permissions section to enforce pull-request rules workflow (#4079)
GitHub Bot complained about that in PR #4072.

Related to #4073
2026-04-01 21:55:27 +02:00

30 lines
885 B
YAML

# This workflow enforces on every pull request that the PR is not based against master,
# taken from https://github.com/oppia/oppia-android/blob/develop/.github/workflows/static_checks.yml
name: "Enforce Pull-Request Rules"
permissions:
contents: read
on:
pull_request:
push:
branches-ignore:
- develop
- master
jobs:
check:
runs-on: ubuntu-slim
if: github.event_name == 'pull_request'
timeout-minutes: 10
steps:
- name: "Branch is not based on develop"
if: ${{ github.base_ref != 'develop' && !contains(github.event.pull_request.labels.*.name, 'mastermerge') }}
run: |
echo "Current base branch: $BASE_BRANCH"
echo "Note: PRs should only ever be merged into develop so please rebase your branch on develop and try again."
exit 1
env:
BASE_BRANCH: ${{ github.base_ref }}