From 883ad5c2d5a57e0d6a1bf0902bff5054c554c75e Mon Sep 17 00:00:00 2001 From: veeck Date: Tue, 7 Feb 2023 18:39:58 +0100 Subject: [PATCH] Add workflow rule to prohibit PRs against master --- .github/workflows/depsreview.yaml | 2 +- .github/workflows/enforce-changelog.yaml | 19 ------------- .../workflows/enforce-pullrequest-rules.yaml | 28 +++++++++++++++++++ CHANGELOG.md | 1 + 4 files changed, 30 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/enforce-changelog.yaml create mode 100644 .github/workflows/enforce-pullrequest-rules.yaml diff --git a/.github/workflows/depsreview.yaml b/.github/workflows/depsreview.yaml index e7c5530b36..0f4e2181c9 100644 --- a/.github/workflows/depsreview.yaml +++ b/.github/workflows/depsreview.yaml @@ -1,4 +1,4 @@ -name: "Dependency Review" +name: "Review Dependencies" on: [pull_request] permissions: diff --git a/.github/workflows/enforce-changelog.yaml b/.github/workflows/enforce-changelog.yaml deleted file mode 100644 index 9632ac2d29..0000000000 --- a/.github/workflows/enforce-changelog.yaml +++ /dev/null @@ -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" diff --git a/.github/workflows/enforce-pullrequest-rules.yaml b/.github/workflows/enforce-pullrequest-rules.yaml new file mode 100644 index 0000000000..7fe31b360d --- /dev/null +++ b/.github/workflows/enforce-pullrequest-rules.yaml @@ -0,0 +1,28 @@ +# This workflow enforces on every pull request: +# - the update of our CHANGELOG.md file +# - that the PR is not based against master + +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' }} + run: | + echo "This PR is based against the master branch. Please don't do this. Switch the branch to 'develop'." + exit 1 + env: + BASE_BRANCH: ${{ github.base_ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bb0413d5e..ed5dc8ebd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,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 Enforce PR rules workflow ### Removed