From 627be1d8dbc4dc22d68613c4c397910eeb5bc9bb Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Thu, 9 May 2024 09:53:03 +0100 Subject: [PATCH 1/2] Fix codefreeze to check PR target branch correctly Signed-off-by: Andrew Leonard --- .github/workflows/code-freeze.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-freeze.yml b/.github/workflows/code-freeze.yml index 5f06ab6..166d377 100644 --- a/.github/workflows/code-freeze.yml +++ b/.github/workflows/code-freeze.yml @@ -1,9 +1,23 @@ +# ******************************************************************************** +# Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made +# available under the terms of the Apache Software License 2.0 +# which is available at https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************** + name: Code Freeze Bot # Controls when the workflow will run on: pull_request_target: - branches: [ "master" ] + branches: + - '*' issue_comment: types: [created] @@ -12,6 +26,15 @@ permissions: pull-requests: write jobs: - codefreeze: + # Check if the pull request target branch matches the required branch-regex? + codefreeze_branch_check: + uses: adoptium/.github/.github/workflows/code-freeze-regex-branch.yml@main + with: + branch-regex: "^master$" + + # Code freeze if branch-regex matches + codefreeze_if_branch_match: + needs: codefreeze_branch_check uses: adoptium/.github/.github/workflows/code-freeze.yml@main + if: (github.event_name == 'pull_request_target' || (github.event_name == 'issue_comment' && github.event.issue.pull_request)) && needs.codefreeze_branch_check.outputs.regex-matches == 'true' secrets: inherit From d10764363d2854fe642838c5c5346e8bf2124b4b Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Thu, 9 May 2024 15:20:51 +0100 Subject: [PATCH 2/2] Simplify the code-freeze yml Signed-off-by: Andrew Leonard --- .github/workflows/code-freeze.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/code-freeze.yml b/.github/workflows/code-freeze.yml index 166d377..81eac2e 100644 --- a/.github/workflows/code-freeze.yml +++ b/.github/workflows/code-freeze.yml @@ -16,8 +16,6 @@ name: Code Freeze Bot # Controls when the workflow will run on: pull_request_target: - branches: - - '*' issue_comment: types: [created]