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>
This commit is contained in:
Veeck 2023-02-16 18:18:18 +01:00 committed by GitHub
parent e24dfa6b1a
commit 88c7e42368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 26 deletions

View File

@ -20,14 +20,14 @@ jobs:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout code
- name: "Checkout code"
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: "Use Node.js ${{ matrix.node-version }}"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies and run tests
- name: "Install dependencies and run tests"
run: |
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99

View File

@ -17,16 +17,16 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
- name: "Checkout code"
uses: actions/checkout@v3
- name: Install dependencies and run coverage
- name: "Install dependencies and run coverage"
run: |
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99
npm ci
touch css/custom.css
npm run test:coverage
- name: Upload coverage results to codecov
- name: "Upload coverage results to codecov"
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info

View File

@ -1,4 +1,8 @@
name: "Dependency Review"
# This workflow scans your pull requests for dependency changes, and will raise an error if any vulnerabilities or invalid licenses are being introduced.
# For more information see: https://github.com/actions/dependency-review-action
name: "Review Dependencies"
on: [pull_request]
permissions:

View File

@ -1,19 +0,0 @@
# This workflow enforces the update of a changelog file on every pull request
# For more information see: https://github.com/dangoslen/changelog-enforcer
name: "Enforce Changelog"
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"

View File

@ -0,0 +1,28 @@
# 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 }}

View File

@ -65,6 +65,7 @@ Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not al
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and "ignoreContentSecurityPolicy"
- Added thai language
- Added workflow rule to make sure PRs are based against develop
### Removed