finnnal#101
Conversation
There was a problem hiding this comment.
Pull request overview
Adds manual triggering and adjusts deploy gating in the GitHub Actions CI/CD workflow for the FarmSmart project.
Changes:
- Adds
workflow_dispatchso the pipeline can be started manually. - Tweaks commented Jest test step formatting.
- Switches Render deploy hook presence checks from
env.*tosecrets.*in the deploy steps.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
workflow_dispatch was added, but the deploy job is still gated by if: github.event_name == 'push', so manually running the workflow will never deploy. If the intent is to allow manual deploys, update the deploy job if to also allow workflow_dispatch (or make that behavior explicit by renaming/adding a separate manual deploy workflow).
| #- name: Run Tests (Jest) | ||
| # run: npm test -- --passWithNoTests |
There was a problem hiding this comment.
The commented-out Jest step is formatted as #- name / # run, which is easy to misread and inconsistent with the rest of the YAML. Consider either removing these commented lines entirely or formatting them as standard commented YAML (# - name, # run) so it’s obvious how to re-enable the step.
| #- name: Run Tests (Jest) | |
| # run: npm test -- --passWithNoTests | |
| # - name: Run Tests (Jest) | |
| # run: npm test -- --passWithNoTests |
| steps: | ||
| - name: Trigger Render Deploy (Backend) | ||
| if: env.RENDER_DEPLOY_HOOK_BACKEND != '' | ||
| if: "${{ secrets.RENDER_DEPLOY_HOOK_BACKEND != '' }}" |
There was a problem hiding this comment.
The step-level if is wrapped in quotes (if: "${{ ... }}"). While it may still evaluate, it’s non-idiomatic and can lead to confusing type coercion. Prefer if: ${{ secrets.RENDER_DEPLOY_HOOK_BACKEND != '' }} (no quotes) for a clear boolean condition.
| - name: Trigger Render Deploy (Backend) | ||
| if: env.RENDER_DEPLOY_HOOK_BACKEND != '' | ||
| if: "${{ secrets.RENDER_DEPLOY_HOOK_BACKEND != '' }}" | ||
| run: curl "${{ secrets.RENDER_DEPLOY_HOOK_BACKEND }}" |
There was a problem hiding this comment.
curl will exit 0 for many HTTP error responses unless --fail is used, which can make the deploy step look successful even when the Render hook returns 4xx/5xx. Consider using curl --fail --show-error --silent (and optionally retries) so CI correctly fails on unsuccessful deploy triggers.
| - name: Trigger Render Deploy (Frontend) | ||
| if: env.RENDER_DEPLOY_HOOK_FRONTEND != '' | ||
| if: "${{ secrets.RENDER_DEPLOY_HOOK_FRONTEND != '' }}" | ||
| run: curl "${{ secrets.RENDER_DEPLOY_HOOK_FRONTEND }}" |
There was a problem hiding this comment.
Same as the backend deploy step: consider using curl --fail --show-error --silent (and optionally retries) so the workflow fails when the Render hook responds with an error status instead of reporting a false-green deploy.
|
|
||
| - name: Trigger Render Deploy (Frontend) | ||
| if: env.RENDER_DEPLOY_HOOK_FRONTEND != '' | ||
| if: "${{ secrets.RENDER_DEPLOY_HOOK_FRONTEND != '' }}" |
There was a problem hiding this comment.
The frontend deploy step if is also wrapped in quotes (if: "${{ ... }}"). Prefer the unquoted boolean expression form (if: ${{ secrets.RENDER_DEPLOY_HOOK_FRONTEND != '' }}) for clarity and to avoid confusing coercion.
No description provided.