Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix codefreeze to check PR target branch correctly #164

Merged
merged 2 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/workflows/code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# ********************************************************************************
# 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" ]
issue_comment:
types: [created]

Expand All @@ -12,6 +24,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