diff --git a/.github/workflows/code-freeze-new.yml b/.github/workflows/code-freeze-new.yml index 35760efbc..0ba7d1d3d 100644 --- a/.github/workflows/code-freeze-new.yml +++ b/.github/workflows/code-freeze-new.yml @@ -26,18 +26,15 @@ permissions: contents: write pull-requests: write - - - - - - - - jobs: - codefreeze_regex: + codefreeze_branch_check: uses: andrew-m-leonard/openjdk-build/.github/workflows/code-freeze-regex-branch.yml@master - secrets: inherit with: branch-regex: "^maa.*er$" + 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 + diff --git a/.github/workflows/code-freeze-regex-branch.yml b/.github/workflows/code-freeze-regex-branch.yml index 0b53da496..644d7c747 100644 --- a/.github/workflows/code-freeze-regex-branch.yml +++ b/.github/workflows/code-freeze-regex-branch.yml @@ -21,6 +21,10 @@ on: branch-regex: required: true type: string + outputs: + regex-matches: + description: "Whether the pull request target branch matches the input branch-regex" + value: ${{ jobs.check-freeze-branch.outputs.code_freeze_branch }} permissions: contents: write @@ -62,7 +66,3 @@ jobs: PR_TARGET_BRANCH: ${{ steps.get-pr-target-branch.outputs.pr_target_branch }} BRANCH_REGEX: ${{ inputs.branch-regex }} - - 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)) && steps.check-freeze-branch.outputs.code_freeze_branch == 'true' - secrets: inherit -