MagicMirror/.github/workflows/enforce-pullrequest-rules.yaml
Veeck 88c7e42368
Enforce PRs to be based against develop branch (#3031)
"Inspired" by my mistake in
https://github.com/MichMich/MagicMirror/pull/3028 this PR will add a
worfklow check for the branch a PR is based against.

Open question is if this prevents @MichMich from preparing a release?

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-16 18:18:18 +01:00

29 lines
1.0 KiB
YAML

# This workflow enforces on every pull request:
# - the update of our CHANGELOG.md file, see: https://github.com/dangoslen/changelog-enforcer
# - that the PR is not based against master, taken from https://github.com/oppia/oppia-android/pull/2832/files
name: "Enforce Pull-Request Rules"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Enforce changelog"
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: "CHANGELOG.md"
skipLabels: "Skip Changelog"
- name: "Enforce develop branch"
if: ${{ github.base_ref == 'master' && !contains(github.event.pull_request.labels.*.name, 'mastermerge') }}
run: |
echo "This PR is based against the master branch and not a release or hotfix."
echo "Please don't do this. Switch the branch to 'develop'."
exit 1
env:
BASE_BRANCH: ${{ github.base_ref }}