Skip to content
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
42 changes: 36 additions & 6 deletions .github/workflows/staging-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ jobs:
TAG: ${{ steps.get-tag.outputs.tag }}

staging-release-images-latest-tags:
# Only update latest tags for 4.0 releases
if: startsWith(github.event.inputs.version, '4.')
# Only update latest tags for 5.0 releases
if: startsWith(github.event.inputs.version, '5.0')
name: Release latest Linux container images
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -874,6 +874,7 @@ jobs:
generate_release_notes: true
name: "Fluent Bit ${{ inputs.version }}"
tag_name: v${{ inputs.version }}
target_commitish: '4.0'
make_latest: false

- name: Release 4.1 - not latest
Expand All @@ -885,19 +886,32 @@ jobs:
generate_release_notes: true
name: "Fluent Bit ${{ inputs.version }}"
tag_name: v${{ inputs.version }}
target_commitish: '4.1'
make_latest: false

- name: Release 4.2 and latest
- name: Release 4.2 - not latest
uses: softprops/action-gh-release@v2
if: startsWith(inputs.version, '4.2')
with:
body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
draft: false
generate_release_notes: true
name: "Fluent Bit ${{ inputs.version }}"
tag_name: v${{ inputs.version }}
target_commitish: '4.2'
make_latest: false
Comment on lines +892 to +902

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For softprops/action-gh-release@v2/ the GitHub Releases API, what branch or commit is used whentarget_commitishis omitted andtag_name does not already exist?

💡 Result:

If you create a release with tag_name that doesn’t already exist and you omit target_commitish, GitHub will create the tag from the repository’s default branch, i.e. the current HEAD commit of the default branch at the time the API call runs (typically main or master). [1]

softprops/action-gh-release@v2 follows this behavior: when you don’t set the target_commitish input, the action passes target_commitish as undefined to repos.createRelease, effectively leaving it omitted so GitHub falls back to the default branch. [2]

Sources:
[1] GitHub REST API “Create a release” (target_commitish default) https://docs.github.com/en/rest/releases/releases
[2] softprops/action-gh-release implementation (target_commitish = config.input_target_commitish) https://raw.githubusercontent.com/softprops/action-gh-release/master/src/github.ts


Add target_commitish: '4.2' to pin the release target to the 4.2 branch.

When softprops/action-gh-release creates a new tag that doesn't already exist and target_commitish is omitted, it defaults to the repository's default branch instead of the specified branch. For 4.2 releases, this would create the tag from the wrong branch.

Patch
       - name: Release 4.2 - not latest
         uses: softprops/action-gh-release@v2
         if: startsWith(inputs.version, '4.2')
         with:
           body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
           draft: false
           generate_release_notes: true
           name: "Fluent Bit ${{ inputs.version }}"
           tag_name: v${{ inputs.version }}
+          target_commitish: '4.2'
           make_latest: false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/staging-release.yaml around lines 890 - 899, The release
step "Release 4.2 - not latest" using softprops/action-gh-release@v2 needs to
pin the tag target to the 4.2 branch by adding a target_commitish entry; update
the step's with block (the step identified by name "Release 4.2 - not latest"
and uses: softprops/action-gh-release@v2) to include target_commitish: '4.2' so
newly created tags are based on the 4.2 branch rather than the default branch.


- name: Release 5.0 and latest
uses: softprops/action-gh-release@v2
if: startsWith(inputs.version, '5.0')
with:
body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
draft: false
generate_release_notes: true
name: "Fluent Bit ${{ inputs.version }}"
tag_name: v${{ inputs.version }}
make_latest: true

staging-release-windows-checksums:
name: Get Windows checksums for new release
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -1020,13 +1034,23 @@ jobs:
with:
repository: fluent/fluent-bit-docs
token: ${{ secrets.GH_PA_TOKEN }}
ref: '4.1'

- name: Release 4.2 and latest
- name: Release 4.2 - not latest
if: startsWith(inputs.version, '4.2')
uses: actions/checkout@v6
with:
repository: fluent/fluent-bit-docs
token: ${{ secrets.GH_PA_TOKEN }}
ref: '4.2'

- name: Release 5.0 and latest
if: startsWith(inputs.version, '5.0')
uses: actions/checkout@v6
with:
repository: fluent/fluent-bit-docs
token: ${{ secrets.GH_PA_TOKEN }}
ref: master

- name: Ensure we have the script we need
run: |
Expand Down Expand Up @@ -1135,8 +1159,14 @@ jobs:
if: startsWith(inputs.version, '4.2')
uses: actions/checkout@v6
with:
ref: master
ref: '4.2'

- name: Release 5.0
if: startsWith(inputs.version, '5.0')
uses: actions/checkout@v6
with:
ref: master

# Get the new version to use
- name: 'Get next minor version'
id: semvers
Expand Down
Loading