Skip to content

fix env vars in workflows#3135

Merged
frzyc merged 1 commit into
masterfrom
fix_workflow
Jan 3, 2026
Merged

fix env vars in workflows#3135
frzyc merged 1 commit into
masterfrom
fix_workflow

Conversation

@frzyc

@frzyc frzyc commented Jan 2, 2026

Copy link
Copy Markdown
Owner

Describe your changes

Update workflow to apply env vars per step. The current echo method seems to lag behind.

Issue or discord link

Testing/validation

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

  • I have commented my code in hard-to understand areas.
  • I have made corresponding changes to README or wiki.
  • For front-end changes, I have updated the corresponding English translations.
  • I have run yarn run mini-ci locally to validate format and lint.
  • If I have added a new library or app, I have updated the deployment scripts to ignore changes as needed

Summary by CodeRabbit

Release Notes

  • Chores
    • Internal optimization of build pipeline configuration for improved build consistency and efficiency.

✏️ Tip: You can customize this high-level summary in your review settings.

@frzyc frzyc requested a review from nguyentvan7 January 2, 2026 20:13
@coderabbitai

coderabbitai Bot commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Three GitHub Actions workflow files are refactored to consolidate how NX_* environment variables are set. Instead of inline shell assignments or echoing to $GITHUB_ENV, these variables are now declared using explicit env blocks within their respective steps. One workflow also updates a Git SHA reference to use the native github.sha context variable.

Changes

Cohort / File(s) Summary
Environment Variable Refactoring (CI Workflows)
.github/workflows/build-frontend.yml, .github/workflows/build-new-release.yml, .github/workflows/build-somnia.yml
Consolidates NX_* variable declarations from inline/echo-based assignments to centralized env blocks. In build-new-release.yml, replaces git rev-parse HEAD with ${{ github.sha }} for commit reference. Improves clarity and maintainability of environment setup across build steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • frzyc/genshin-optimizer#2707: Directly modifies the same NX_* CI environment variables (NX_URL_GITHUB_GO_CURRENT_VERSION, NX_DAEMON, NX_SHOW_DEV_COMPONENTS) in build-frontend.yml with overlapping intent.

Suggested labels

CI

Poem

Env blocks rise, where echoes once did dwell,
Three workflows cleaned, a CI janitor's spell,
At 3 AM, these variables align,
Like pulling gold—pristine and fine! 🎲

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix env vars in workflows' directly summarizes the main change—refactoring environment variables in GitHub Actions workflows from echo method to per-step env blocks.
Description check ✅ Passed The description includes the required sections with the main change explained and a Discord link provided, though testing/validation details are incomplete and all checklist items remain unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df88cb1 and 7928201.

📒 Files selected for processing (3)
  • .github/workflows/build-frontend.yml
  • .github/workflows/build-new-release.yml
  • .github/workflows/build-somnia.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: format
  • GitHub Check: typecheck
  • GitHub Check: lint
  • GitHub Check: test
  • GitHub Check: gen-file
🔇 Additional comments (3)
.github/workflows/build-somnia.yml (1)

77-78: Clean refactor to env block—LGTM!

yawns Finally, no more sketchy echo-to-GITHUB_ENV gymnastics at 3 AM... This env block approach is way cleaner. NX_DAEMON: false will keep the daemon from spawning in CI, which is exactly what we want for reproducible builds.

Just like guaranteed pity in gacha, this is a guaranteed improvement.

.github/workflows/build-frontend.yml (1)

57-60: Nice consolidation—no more env variable gacha!

stares blearily at screen This is much better than the old approach. Using github.sha directly instead of shelling out to git rev-parse HEAD is like pulling a 5-star on your first roll—clean, efficient, no RNG involved.

The three env vars look good:

  • NX_URL_GITHUB_GO_CURRENT_VERSION with the commit URL
  • NX_DAEMON: false for CI stability
  • NX_SHOW_DEV_COMPONENTS from workflow inputs

Just make sure the builds still complete successfully with github.sha—it should be equivalent to what was there before, but worth confirming the artifacts are identical.

Could you verify the workflow runs successfully and produces the expected build artifacts?

.github/workflows/build-new-release.yml (1)

50-52: Solid refactor for release builds!

chugs another energy drink This is the most critical workflow of the bunch since it handles releases. Moving to explicit env blocks is definitely the right call—no more worrying about timing issues with $GITHUB_ENV echoing.

Using ${{ github.sha }} here is perfect for tracking which commit a release was built from. It's like having a guaranteed SSR character—always reliable, always there when you need it.

Since this is the release pipeline, please verify this works correctly before merging. The last thing we need is a borked release build at 4 AM when the gacha servers reset.

Please confirm the release workflow completes successfully with these changes—maybe test on a non-release PR first?


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.

@github-actions

github-actions Bot commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

[zzz-frontend] [Fri Jan 2 20:15:58 UTC 2026] - Deployed a624983 to https://genshin-optimizer-prs.github.io/pr/3135/zzz-frontend (Takes 3-5 minutes after this completes to be available)

[frontend] [Fri Jan 2 20:16:13 UTC 2026] - Deployed a624983 to https://genshin-optimizer-prs.github.io/pr/3135/frontend (Takes 3-5 minutes after this completes to be available)

[sr-frontend] [Fri Jan 2 20:16:39 UTC 2026] - Deployed a624983 to https://genshin-optimizer-prs.github.io/pr/3135/sr-frontend (Takes 3-5 minutes after this completes to be available)

[Sat Jan 3 01:48:48 UTC 2026] - Deleted deployment

@frzyc frzyc merged commit 3a89359 into master Jan 3, 2026
10 checks passed
@frzyc frzyc deleted the fix_workflow branch January 3, 2026 01:47
@coderabbitai coderabbitai Bot mentioned this pull request May 16, 2026
5 tasks
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