Skip to content

Commit

Permalink
Fix codefreeze to check PR target branch correctly (#3794)
Browse files Browse the repository at this point in the history
* Fix codefreeze to check PR target branch correctly

Signed-off-by: Andrew Leonard <[email protected]>

* fix license checker

---------

Signed-off-by: Andrew Leonard <[email protected]>
Co-authored-by: George Adams <[email protected]>
  • Loading branch information
andrew-m-leonard and gdams authored May 7, 2024
1 parent 9982cfe commit 797c3f0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ********************************************************************************
# Copyright (c) 2023 Contributors to the Eclipse Foundation
# Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) with this work for additional
# information regarding copyright ownership.
Expand All @@ -16,7 +16,8 @@ name: Code Freeze Bot
# Controls when the workflow will run
on:
pull_request_target:
branches: [ "v[0-9]+.[0-9]+.[0-9]+" ]
branches:
- '*'
issue_comment:
types: [created]

Expand All @@ -25,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: "^v[0-9]+.[0-9]+.[0-9]+$"

# 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
13 changes: 13 additions & 0 deletions .github/workflows/semgrep_diff.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# ********************************************************************************
# Copyright (c) 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: Semgrep Differential Scan
on:
Expand Down
3 changes: 2 additions & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ header:
SPDX-License-Identifier: Apache-2.0
********************************************************************************
pattern: Copyright (c) \d{4} Contributors to the Eclipse Foundation
pattern: Copyright (c) ((\d{4})(, \d{4})*) Contributors to the Eclipse Foundation

comment: on-failure

Expand All @@ -39,6 +39,7 @@ header:
- '**/*.asc'
- '.gitignore'
- '.dockerignore'
- '.semgrepignore'
- 'docker/.gitignore'
- 'security/.gitignore'
- 'security/mk-ca-bundle.pl'
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Create release branch in the format `vYYYY.MM.NN` on each of the following repos
- ci-jenkins-pipelines <https://github.com/adoptium/ci-jenkins-pipelines>
- jenkins-helper <https://github.com/adoptium/jenkins-helper>

These branches should be named according to the following format (vYYYY.MM+NN) ,e.g v2023.03+01 , whereby the final element is an incremental counter appended to the year and month of the release.
These branches should be named according to the following format (vYYYY.MM.NN) ,e.g v2023.03.01 , whereby the final element is an incremental counter appended to the year and month of the release.

If anything needs to be merged into the new branch, it should typically be merged into master, then a `git cherry-pick` operation should be done to create a new PR against the release branch. This can typically be merged without further approval.

Expand Down

0 comments on commit 797c3f0

Please sign in to comment.