Skip to content

correct dev deploy trigger#13

Merged
4others merged 1 commit intomainfrom
chore-correct-dev-deploy-trigger
Feb 27, 2026
Merged

correct dev deploy trigger#13
4others merged 1 commit intomainfrom
chore-correct-dev-deploy-trigger

Conversation

@4others
Copy link
Contributor

@4others 4others commented Feb 27, 2026

Summary by CodeRabbit

  • Chores
    • Enhanced deployment automation workflow to improve consistency and reliability when handling automated synchronization processes across environments.

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Walkthrough

Modified GitHub Actions workflow to support workflow_run trigger events. Added conditional logic to the build-server job execution, updated image tagging to use appropriate commit SHA based on trigger type (push or workflow_run), and adjusted checkout reference handling for workflow_run events.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Configuration
.github/workflows/deploy-dev.yaml
Added workflow_run trigger for "Sync main to dev" workflow completion. Introduced conditional execution guard on build-server job. Updated image tagging logic with conditional SHA selection: dev-${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}. Modified checkout ref to use dev branch for workflow_run events. Updated deployment tagging to align with workflow_run head_sha logic.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: fixing the GitHub Actions workflow trigger logic for dev deployments by adding workflow_run conditions and correcting the commit SHA tagging.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-correct-dev-deploy-trigger

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@4others 4others requested a review from webpiratt February 27, 2026 15:15
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/deploy-dev.yaml (1)

33-33: Deduplicate SHA/tag expression to avoid drift.

The same conditional SHA logic appears in Line 33 and Line 57. Centralize it in a single env variable so build/deploy tagging can’t diverge later.

Refactor sketch
 env:
   REGISTRY: ghcr.io
   IMAGE_NAME: ${{ github.repository }}
   NS: agent
+  DEPLOY_SHA: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}

@@
-      tag: dev-${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
+      tag: dev-${{ env.DEPLOY_SHA }}

@@
-          TAG="dev-${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}"
+          TAG="dev-${{ env.DEPLOY_SHA }}"

Also applies to: 57-57

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy-dev.yaml at line 33, Create a single reusable
environment variable (e.g., DEPLOY_TAG or TAG_SHA) at the workflow or job level
and assign it the conditional expression currently used in the tag field (the
dev-${{ github.event_name == 'workflow_run' &&
github.event.workflow_run.head_sha || github.sha }} expression); then replace
both occurrences of the inline tag expression (the "tag: dev-${{ ... }}" usage)
with a reference to that env variable so both build and deploy use the exact
same computed tag value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy-dev.yaml:
- Around line 10-13: The workflow_run trigger is currently unscoped and will
fire for any completed run of "Sync main to dev"; update the workflow_run block
to include a branches filter (e.g., branches: ["main"]) so it only triggers when
the upstream workflow ran on the intended upstream branch; modify the
workflow_run stanza (the keys workflow_run and workflows: ["Sync main to dev"])
to add a branches entry constraining runs to "main".
- Around line 46-47: Replace the mutable checkout ref with an immutable commit
SHA: update the checkout step's with.ref expression (the "ref" key in the
checkout step) to use github.sha for push events and
github.event.workflow_run.head_sha for workflow_run events so the checked-out
code matches the image tag; i.e., change the conditional that currently selects
github.ref or 'dev' to select github.sha when github.event_name == 'push' and
github.event.workflow_run.head_sha when github.event_name == 'workflow_run'.

---

Nitpick comments:
In @.github/workflows/deploy-dev.yaml:
- Line 33: Create a single reusable environment variable (e.g., DEPLOY_TAG or
TAG_SHA) at the workflow or job level and assign it the conditional expression
currently used in the tag field (the dev-${{ github.event_name == 'workflow_run'
&& github.event.workflow_run.head_sha || github.sha }} expression); then replace
both occurrences of the inline tag expression (the "tag: dev-${{ ... }}" usage)
with a reference to that env variable so both build and deploy use the exact
same computed tag value.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d775c8 and b2e7d08.

📒 Files selected for processing (1)
  • .github/workflows/deploy-dev.yaml

@4others 4others merged commit 85aac04 into main Feb 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants