Skip to content

feat: use GitHub Actions environments in generated CI/CD workflows#298

Merged
shazron merged 3 commits into
masterfrom
copilot/update-ci-cd-workflows-github-actions
Apr 28, 2026
Merged

feat: use GitHub Actions environments in generated CI/CD workflows#298
shazron merged 3 commits into
masterfrom
copilot/update-ci-cd-workflows-github-actions

Conversation

Copilot AI commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #297

Generated CI/CD workflows used environment-specific secret name suffixes (_PROD, _STAGE) to differentiate credentials. This approach should be replaced with GitHub Actions environments, which scope secrets natively per environment.

Changes

  • deploy_prod.yml — added environment: production to the deploy job; stripped _PROD suffix from all secrets
  • deploy_stage.yml — added environment: stage to the deploy job; stripped _STAGE suffix from all secrets
  • pr_test.yml — added environment: stage to the test job; stripped _STAGE suffix from all secrets
  • Tests — updated assertions to verify environment declarations are present and old suffixed secret references are absent

Before / After

# Before
deploy:
  name: Deploy to Prod
  runs-on: ${{ matrix.os }}
  # ...
  CLIENTID: ${{ secrets.CLIENTID_PROD }}

# After
deploy:
  name: Deploy to Prod
  runs-on: ${{ matrix.os }}
  environment: production
  # ...
  CLIENTID: ${{ secrets.CLIENTID }}

Secrets with identical names are now configured once per GitHub Actions environment (production / stage) rather than duplicated under different names in the same repository secret store.

Copilot AI changed the title [WIP] Update all CI/CD workflows to use GitHub Actions environments Use GitHub Actions environments in generated CI/CD workflows Apr 27, 2026
Copilot AI requested a review from shazron April 27, 2026 09:55
github-actions[bot]
github-actions Bot previously approved these changes Apr 27, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 PR Reviewer

This diff refactors GitHub Actions workflows to use GitHub Environments (production/stage) with environment-scoped secrets instead of environment-suffixed secret names. The approach is valid and leverages GitHub's built-in environment protection rules. Tests are updated accordingly and cover the key changes well.

LGTM! This PR looks good to merge.


💡 How to re-trigger

Comment /review or /pr-reviewer on this PR

@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread generators/add-ci/.github/workflows/pr_test.yml
@shazron
shazron marked this pull request as ready for review April 27, 2026 10:13
@github-actions
github-actions Bot dismissed their stale review April 27, 2026 10:14

Superseded by new review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 PR Reviewer

This diff refactors GitHub Actions workflows to use environment-scoped secrets via GitHub Environments (production/stage) instead of environment-suffixed secret names. The change is clean, well-tested, and follows GitHub best practices for environment-specific secrets. The addition of environment protection rules is a security improvement as it enables required reviewers and deployment gates.

LGTM! This PR looks good to merge.


💡 How to re-trigger

Comment /review or /pr-reviewer on this PR

@shazron shazron changed the title Use GitHub Actions environments in generated CI/CD workflows feat: use GitHub Actions environments in generated CI/CD workflows Apr 28, 2026
@shazron
shazron merged commit e0cbb81 into master Apr 28, 2026
11 checks passed
@shazron
shazron deleted the copilot/update-ci-cd-workflows-github-actions branch April 28, 2026 07:17
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.

update all CI/CD workflows to user Github Actions environments

3 participants