Fly deploy: target 'production' environment so env-scoped secrets resolve#36
Merged
Conversation
The AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY secrets were added under "Environment secrets → Production", but the job had no environment: declaration, so secrets.X only resolved against repository scope and came back empty. The action then fell through to its default credential chain (OIDC / IMDS / env), found nothing, and reported "Could not load credentials from any providers." Adds: - environment: production on the deploy job (reads the env-scoped secrets the user already configured). - A "Verify required secrets" step that fails fast with a clear ::error:: message naming which secret is missing and linking to the environments page. Future onboarders get a one-line diagnosis instead of a generic AWS SDK error.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this PR exists
Your
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYare stored as Environment secrets under theProductionenvironment (good practice — keeps prod creds separate from PR-time stuff). But the workflow's job didn't declare anenvironment:, so${{ secrets.AWS_ACCESS_KEY_ID }}only looked at repository-scope secrets and resolved empty. The aws-actions step then fell through and reported:Fix
environment: productionon the deploy job → secrets stored under the Production environment become visible::error::message naming which secret is missing, linking to the environments settings pageAfter this merges
The next workflow run will pass the AWS step. Two remaining requirements:
FLY_API_TOKENto the same Production environment (not Repository secrets). Get the value from https://fly.io/user/personal_access_tokens.Test plan
Generated by Claude Code