Skip to content

Commit 5e8f0a6

Browse files
committed
update Enforce Pull-Request Rules
1 parent e7ad361 commit 5e8f0a6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
# This workflow enforces on every pull request that the PR is not based against master,
2-
# taken from https://github.com/oppia/oppia-android/pull/2832/files
2+
# taken from https://github.com/oppia/oppia-android/blob/develop/.github/workflows/static_checks.yml
33

44
name: "Enforce Pull-Request Rules"
55

66
on:
77
pull_request_target:
88
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
9+
pull_request:
10+
push:
11+
branches-ignore:
12+
- develop
13+
- master
914

1015
jobs:
1116
check:
1217
runs-on: ubuntu-latest
18+
if: github.event_name == 'pull_request'
1319
timeout-minutes: 10
1420
steps:
15-
- name: "Enforce develop branch"
16-
if: ${{ github.event.pull_request.base.ref == 'master' && !contains(github.event.pull_request.labels.*.name, 'mastermerge') }}
21+
- name: "Branch is not based on develop"
22+
if: ${{ github.base_ref != 'develop' && !contains(github.event.pull_request.labels.*.name, 'mastermerge') }}
1723
run: |
18-
echo "This PR is based against the master branch and not a release or hotfix."
19-
echo "Please don't do this. Switch the branch to 'develop'."
24+
echo "Current base branch: $BASE_BRANCH"
25+
echo "Note: PRs should only ever be merged into develop so please rebase your branch on develop and try again."
2026
exit 1
2127
env:
22-
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
28+
BASE_BRANCH: ${{ github.base_ref }}

0 commit comments

Comments
 (0)