Files
MagicMirror/.github/workflows/enforce-pullrequest-rules.yaml
Karsten Hassel 1998b6273b testing: update "Enforce Pull-Request Rules" workflow (#3987)
With this update the workflow file from inside the feature branch is
used, not the old stuff coming from `master` as before. This does not
help for the currently failing job which still comes from `master` (we
have to live with this until next release), but this will help in the
future to prevent such errors.

Tested this on my fork:
- base against `develop`: workflow is skipped
- base against `master`: workflow fails
- base against `master` with label `mastermerge`: workflow is skipped

I took this new workflow from the same repo where the previous workflows
was taken (see diff for the link) so this is the further development.
2025-12-10 22:28:34 +01:00

27 lines
856 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"
on:
pull_request:
push:
branches-ignore:
- develop
- master
jobs:
check:
runs-on: ubuntu-latest
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 }}