Skip to content

Commit

Permalink
Update code freeze bot to check target PR branch correctly for issue_…
Browse files Browse the repository at this point in the history
…comment

Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard committed Apr 29, 2024
1 parent 079c64b commit 79160b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/code-freeze-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

8 changes: 4 additions & 4 deletions .github/workflows/code-freeze-regex-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 79160b2

Please sign in to comment.