-
Notifications
You must be signed in to change notification settings - Fork 324
chore(ci/release): Re-factor fluent-operator release process #1950
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
base: master
Are you sure you want to change the base?
Changes from all commits
4d037c2
6026045
e04abaf
4211bba
d72fdb8
4f64687
5a7925a
8ec8f8b
55357df
e570135
c38797d
afa4eeb
76ac1d4
9c0ff83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| ".": "3.7.0" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Fluent Operator Code Owners | ||
| # ---------------------- | ||
| # The following file list the code owners or responsibles for code | ||
| # review on different components or extensions of Fluent Bit, applicable for | ||
| # any original code author (not only maintainers). | ||
| # | ||
| # NOTE: if you are a original code author and you are not listed here, please | ||
| # open a PR with the proper modification :) | ||
|
|
||
| # CI | ||
| # ------------------------------------ | ||
| /.github/ @joshuabaird @benjaminhuo @cw-Guo @marcofranssen @wanjunlei | ||
|
|
||
| # CODEOWNERS | ||
| # ------------------------------------ | ||
| .github/CODEOWNERS @joshuabaird @benjaminhuo @cw-Guo @marcofranssen @wanjunlei |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "release-type": "simple", | ||
| "extra-files": [ | ||
| { | ||
| "type": "yaml", | ||
| "path": "charts/fluent-operator/Chart.yaml", | ||
| "jsonpath": "$.appVersion" | ||
| }, | ||
| { | ||
| "type": "yaml", | ||
| "path": "charts/fluent-operator-fluent-bit-crds/Chart.yaml", | ||
| "jsonpath": "$.appVersion" | ||
| }, | ||
| { | ||
| "type": "yaml", | ||
| "path": "charts/fluent-operator-fluentd-crds/Chart.yaml", | ||
| "jsonpath": "$.appVersion" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Lint PR Title | ||
|
|
||
| on: | ||
| # This workflow uses pull_request_target because it needs "pull_request: write" to | ||
| # post comments (not possible with pull_request). | ||
| # | ||
| # WARNING! | ||
| # We MUST ensure that code is NEVER checked out (eg, actions/checkout) in this | ||
| # workflow, otherwise it opens up a path for attacker-controlled PR code execution! | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - edited | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Validate PR title | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 | ||
| id: lint_pr_title | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4 | ||
| if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
| with: | ||
| header: pr-title-lint-error | ||
| message: | | ||
| Thank you for your pull request! :wave: | ||
|
|
||
| Your PR title needs to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format so it can be included correctly in the changelog. | ||
|
|
||
| **Examples of valid titles:** | ||
| - `feat: add support for new filter plugin` | ||
| - `fix: correct nil pointer in controller reconcile` | ||
| - `chore: update dependencies` | ||
| - `docs: improve installation guide` | ||
|
|
||
| **Details:** | ||
| ``` | ||
| ${{ steps.lint_pr_title.outputs.error_message }} | ||
| ``` | ||
|
|
||
| - uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4 | ||
| if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
| with: | ||
| header: pr-title-lint-error | ||
| delete: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
| inputs: | ||
| release-as: | ||
| description: 'Override the next release version (e.g. 3.8.0). Leave empty for automatic versioning from conventional commits.' | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs suggest it needs
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I understand: release-please <4.0 did use "issues" to track the replace process but >=4.0 removed the issue-based workflow any only uses PRs/git tags for driving the release process. |
||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for this, had a hand crafted approach for our stuff so useful to know. |
||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| config-file: .github/release-please-config.json | ||
| manifest-file: .github/.release-please-manifest.json | ||
| release-as: ${{ inputs.release-as }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is always a concern so let's make sure we're secure with it - it's part of the recent supply chain attacks.
I think we should at least comment why it is required and the mitigations in place for future reviews/changes to ensure we do not open things up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for calling this out -- this is a valid concern.
One key thing here to call out is that this workflow is not checking out any code (eg, using
actions/checkout) which is what allowed attacker-controlled code execution in the mentioned supply chain attacks.I have attempted to harden this workflow a bit in 55357df:
pull_request_targetand a warning against adding checkout functionality to the workflowsynchronizetype since PR title changes only occur onopened,reopenedandeditedevents. Thesynchronizetype fires on every new commit push and is unnecessary for this use-caseCODEOWNERSso that only users who are "Admins" of this repo can modify files in the.github/directory