A GitHub Action that sets up the runner environment for Upwave's CI/CD workflows. It reads configuration from AWS SSM Parameter Store and:
- exports deployment variables for the selected environment as workflow environment variables;
- fetches secrets from Parameter Store, masks them, and exports them as environment variables;
- writes
.netrcand~/.npmrcusing an npm token from Parameter Store so subsequent steps can install private@Survatapackages from GitHub Packages.
# AWS credentials must already be configured (the action reads from SSM Parameter Store).
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Set up environment
uses: Survata/gha.environment-setup@v1
with:
environmentName: staging
regionName: us
variableNames: |
API_BASE_URL
FEATURE_FLAGS:FLAGS
secretNames: |
DB_PASSWORD
THIRD_PARTY_API_KEY:API_KEY
npmTokenName: GITHUB_NPM_TOKEN| Input | Required | Default | Description |
|---|---|---|---|
environmentName |
no | — | Environment key into the deployment-variables document (e.g. staging, production). |
regionName |
no | — | Region used to look up DEPLOYMENT_VARIABLES_<REGION> in Parameter Store. If empty, variable export is skipped. |
variableNames |
no | — | Newline-separated list of deployment variables to export. |
secretNames |
no | — | Newline-separated list of Parameter Store secrets to fetch, mask, and export. |
npmTokenName |
yes | GITHUB_NPM_TOKEN |
Parameter Store name of the npm token written to .netrc / ~/.npmrc. |
Each entry in variableNames and secretNames is either NAME (exported under the same name) or
SOURCE:EXPORT (read from SOURCE, exported as EXPORT).
Requires Node 20 (see .nvmrc).
nvm use
yarn install
yarn lint
yarn test # jest
yarn package # rebuilds bin/index.jsThe action runs bin/index.js, a committed bundle produced by @vercel/ncc. You must run
yarn package after any source or dependency change and commit the regenerated bin/index.js
alongside the change. The check commit workflow lints, tests,
and rebuilds the bundle on every push to a non-master branch.
All consumers reference Survata/gha.environment-setup@v1. The v1 tag is a floating tag —
moving it rolls every consumer to the new version on their next workflow run. No consumer-side
changes are required.
The shipped artifact is the committed bin/index.js bundle, not package.json / yarn.lock.
A source or dependency change is not live until the bundle is rebuilt and the v1 tag is moved.
-
Make your source and/or dependency changes on a branch.
-
Reinstall, verify, and regenerate the bundle:
yarn install yarn lint yarn test yarn package -
Commit the regenerated bundle alongside the change, and merge to
master:git add src/ bin/index.js package.json yarn.lock action.yaml git commit -m "Describe the change" # open a PR, get it reviewed, and merge to master
-
Move the
v1tag to the merged commit onmaster. This is the moment of rollout:git checkout master && git pull git tag -f v1 git push origin v1 --forceConsumers pick up the new version on their next workflow run.
-
Optional — cut an immutable version tag for traceability:
git tag v1.1.0 git push origin v1.1.0
⚠️ Merging a Dependabot PR is not a deploy. The artifact that runs in consumer workflows is the committedbin/index.jsbundle, which Dependabot does not regenerate. If you merge a dependency bump and stop there, every consumer keeps running the old code baked intobin/index.js.
To actually ship a dependency update:
- Check out the Dependabot branch so
package.json/yarn.lockare updated. yarn install && yarn lint && yarn test && yarn package.- Commit the regenerated
bin/index.jstogether with the lockfile change. - Merge, then follow Publishing a new version
to move the
v1tag. The rollout is not live untilv1moves.
A quick way to confirm a bump reached the bundle: after yarn package, grep bin/index.js for the
patched code or version string before moving v1.