Skip to content

ci: add workflow_dispatch trigger (stage only) to update-edge-app.yml#5

Merged
nicomiguelino merged 5 commits into
mainfrom
ci/add-workflow-dispatch-to-update-edge-app
May 26, 2026
Merged

ci: add workflow_dispatch trigger (stage only) to update-edge-app.yml#5
nicomiguelino merged 5 commits into
mainfrom
ci/add-workflow-dispatch-to-update-edge-app

Conversation

@nicomiguelino
Copy link
Copy Markdown
Contributor

@nicomiguelino nicomiguelino commented May 26, 2026

  • Add manual trigger that always deploys to stage
  • Simplify job conditions: dispatch runs deploy-stage; production deploys on push to main only
  • Update run-name to resolve environment from event type or git ref
  • Fix echo casing in initialize-edge-app.yml to match update workflow

- Add workflow_dispatch with environment input (stage/production)
- Update job conditions to handle manual dispatch alongside push events
- Update run-name to resolve environment from input or git ref
- Fix echo casing in initialize-edge-app.yml to match update workflow
@nicomiguelino nicomiguelino self-assigned this May 26, 2026
@nicomiguelino nicomiguelino requested a review from Copilot May 26, 2026 15:14
@nicomiguelino nicomiguelino marked this pull request as ready for review May 26, 2026 15:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a manual (workflow_dispatch) trigger to the Edge App update workflow so operators can explicitly choose the target environment, and aligns log output casing between the update and initialize workflows.

Changes:

  • Added workflow_dispatch with an environment choice input (stage/production) to update-edge-app.yml.
  • Updated run-name and per-job if conditions to support manual dispatch alongside branch pushes.
  • Standardized “Current User/Team” echo casing in both workflows.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/update-edge-app.yml Adds manual dispatch + environment selection; updates run naming and job gating logic.
.github/workflows/initialize-edge-app.yml Normalizes echo output casing to match the update workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/update-edge-app.yml Outdated
Comment thread .github/workflows/update-edge-app.yml Outdated
Comment thread .github/workflows/update-edge-app.yml Outdated
nicomiguelino and others added 3 commits May 26, 2026 08:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

.github/workflows/update-edge-app.yml:30

  • With the new workflow_dispatch trigger, a user can run this workflow from an arbitrary branch/ref in the UI. That means selecting environment: production could still check out and deploy the workflow’s selected branch (e.g. development), which risks updating the production Edge App from the wrong code/config. Consider forcing actions/checkout to use main for production dispatches and development for stage dispatches (while keeping github.sha for push runs).
    if: (github.event_name == 'push' && github.ref == 'refs/heads/development') || (github.event_name == 'workflow_dispatch' && inputs.environment == 'stage')
    environment: stage
    steps:
      - uses: actions/checkout@v6
      # TODO: Refactor into Screenly/edge-apps-actions/whoami@v1

.github/workflows/update-edge-app.yml:64

  • Same concern as stage: on workflow_dispatch, the workflow may run from a non-main ref even when inputs.environment == 'production', but the job will still deploy to the production GitHub Environment. This can update production using code/config from the wrong branch. Force checkout to main for production dispatch runs (and keep github.sha for push runs) to avoid accidental misdeploys.
    if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.environment == 'production')
    environment: production
    steps:
      - uses: actions/checkout@v6
      # TODO: Refactor into Screenly/edge-apps-actions/whoami@v1

- Remove environment input; dispatch always targets stage
- Simplify run-name to use literal 'stage' for dispatch events
- Update deploy-stage condition to match any workflow_dispatch
- Remove workflow_dispatch clause from deploy-production condition
@nicomiguelino nicomiguelino changed the title ci: add workflow_dispatch trigger to update-edge-app.yml ci: add workflow_dispatch trigger (stage only) to update-edge-app.yml May 26, 2026
@nicomiguelino nicomiguelino merged commit 1b31554 into main May 26, 2026
1 check passed
@nicomiguelino nicomiguelino deleted the ci/add-workflow-dispatch-to-update-edge-app branch May 26, 2026 15:44
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.

3 participants