Skip to content
Open
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
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build

on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
branches: [ 2.X ]
types: [ opened, synchronize ]
Comment on lines +5 to +6
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

🧩 Analysis chain

PR trigger is too narrow; release steps become dead after removing push trigger.

  • Only opened and synchronize are handled; reopened and ready_for_review are common PR events you likely want.
  • Removing push means the “Zip” and “Update Rolling Release” steps will never execute (they’re explicitly skipped on PRs), effectively disabling rolling releases in this workflow.

Consider re-introducing push (for 2.X) and broadening PR event types:

 on:
-  pull_request:
-    branches: [ 2.X ]
-    types: [ opened, synchronize ]
+  push:
+    branches: [ 2.X ]
+  pull_request:
+    branches: [ 2.X ]
+    types: [ opened, synchronize, reopened, ready_for_review ]

If the intent is to fully decouple releases, split the release steps into a separate workflow triggered on push and remove them from this PR-only workflow.

Run this script to verify whether any other workflow currently handles push-based releases; if none, you’re disabling that path:


🏁 Script executed:

#!/bin/bash
echo "Workflows:"
fd -t f .github/workflows

echo -e "\nWorkflows with 'push' triggers (context shown):"
rg -nC3 -g '.github/workflows/*' $'(?m)^on:\\s*\\n\\s*push:'

echo -e "\nOccurrences of action-gh-release across workflows:"
rg -nC2 -g '.github/workflows/*' 'action-gh-release|Rolling Release'

Length of output: 826


🏁 Script executed:

#!/bin/bash
echo "Workflow files in .github/workflows:"
find .github/workflows -type f

echo -e "\nPush triggers in workflows (lines starting with ‘push:’ under on:):"
grep -R -n -E '^[[:space:]]*push:' .github/workflows

echo -e "\nRelease action occurrences ('action-gh-release' or 'Rolling Release'):"
grep -R -n -E 'action-gh-release|Rolling Release' .github/workflows || true

Length of output: 598


🏁 Script executed:

#!/bin/bash
echo "publish.yml triggers:"
grep -n -P '^on:' -A5 .github/workflows/publish.yml

echo -e "\nbuild.yml triggers:"
grep -n -P '^on:' -A5 .github/workflows/build.yml

Length of output: 197


Reintroduce push trigger and extend PR events in .github/workflows/build.yml

build.yml only runs on pull_request (opened, synchronize), so the Zip and Rolling Release steps (softprops/action-gh-release) never fire. Update to:

 on:
+  push:
+    branches: [2.X]
   pull_request:
     branches: [2.X]
-    types: [opened, synchronize]
+    types: [opened, synchronize, reopened, ready_for_review]

Alternatively, move release steps into a separate push-only workflow.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
branches: [ 2.X ]
types: [ opened, synchronize ]
on:
push:
branches: [2.X]
pull_request:
branches: [2.X]
types: [opened, synchronize, reopened, ready_for_review]
🤖 Prompt for AI Agents
.github/workflows/build.yml lines 5-6: the workflow currently only triggers on
pull_request (opened, synchronize) so push-based release steps never run; update
the workflow to also include a push trigger for the 2.X branch and expand
pull_request types (e.g., opened, synchronize, reopened, ready_for_review) so PR
state changes re-run the workflow, or alternatively move the release steps into
a separate workflow that triggers only on push to 2.X.


jobs:
build:
Expand All @@ -24,10 +23,10 @@ jobs:
name: Build (${{ matrix.release.type }})

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 5.0.x

Expand All @@ -43,7 +42,7 @@ jobs:

- name: Update Rolling Release
if: "! startsWith(github.event_name, 'pull_request')"
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Release step won’t run; add permissions if re-enabled on push.

Given the current PR-only trigger, this step never runs. If you re-enable it on push, explicitly grant token permissions or it may fail with 403.

 jobs:
   build:
+    permissions:
+      contents: write

Optionally, make the condition clearer:

-        if: "! startsWith(github.event_name, 'pull_request')"
+        if: github.event_name != 'pull_request'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: softprops/action-gh-release@v2
jobs:
build:
permissions:
contents: write
steps:
- uses: softprops/action-gh-release@v2
if: github.event_name != 'pull_request'
🤖 Prompt for AI Agents
.github/workflows/build.yml around line 45: the release step uses
softprops/action-gh-release but is currently on a PR-only trigger so it never
runs; if you re-enable it for push events, explicitly add GITHUB_TOKEN
permissions (e.g., permissions: contents: write; packages: write; actions:
write) to the workflow or to that job so the action won’t fail with 403, and
optionally make the step's condition/if expression clearer (e.g., only run on
tags or main branch) to avoid accidental runs.

with:
name: Rolling Release (unstable)
tag_name: rolling
Expand Down
Loading