Skip to content

Commit de65fd2

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

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
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: |
19+
github.event_name == 'pull_request' ||
20+
github.event_name == 'pull_request_target'
1321
timeout-minutes: 10
1422
steps:
15-
- name: "Enforce develop branch"
16-
if: ${{ github.event.pull_request.base.ref == 'master' && !contains(github.event.pull_request.labels.*.name, 'mastermerge') }}
23+
- name: "Enforce changelog"
1724
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'."
25+
echo "Deprecated, no action"
26+
- name: "Branch is not based on develop"
27+
if: ${{ github.base_ref != 'develop' && !contains(github.event.pull_request.labels.*.name, 'mastermerge') }}
28+
run: |
29+
echo "Current base branch: $BASE_BRANCH"
30+
echo "Note: PRs should only ever be merged into develop so please rebase your branch on develop and try again."
2031
exit 1
2132
env:
22-
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
33+
BASE_BRANCH: ${{ github.base_ref }}

0 commit comments

Comments
 (0)