Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
echo "is_dependabot=false" >> "$GITHUB_OUTPUT"
fi

- name: 🪙 Collect Coins (Configure AWS credentials)
- name: 🪙 Collect Coins (Configure AWS credentials)
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/publish-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
workflow_dispatch:
inputs:
version:
description: '🎮 Level to publish (e.g., 1.0.0)'
description: "🎮 Level to publish (e.g., 1.0.0)"
required: true
update-major:
description: '⭐ Update power-up tag (e.g., v1)'
description: "⭐ Update power-up tag (e.g., v1)"
type: boolean
default: true

Expand All @@ -18,7 +18,7 @@ jobs:
publish-action:
runs-on: ubuntu-24.04
timeout-minutes: 15

steps:
- name: 🧱 Enter the Pipe (Checkout)
uses: actions/checkout@v6
Expand All @@ -33,8 +33,8 @@ jobs:
- name: 🍄 Grab a Mushroom (Setup Node.js)
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 📦 Open the ? Block (Install packages)
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -68,9 +68,9 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git add -f github-action/dist/index.js

# Only commit if there are changes
if git diff --staged --quiet; then
echo "ℹ️ No changes to commit"
Expand All @@ -90,9 +90,9 @@ jobs:
if: inputs.update-major == true && steps.version-check.outputs.should_publish == 'true'
run: |
MAJOR_VERSION=$(echo "v${{ inputs.version }}" | cut -d. -f1)

echo "⭐ Collecting star power! Updating $MAJOR_VERSION to v${{ inputs.version }}"

git tag -fa "$MAJOR_VERSION" -m "⭐ Power-up $MAJOR_VERSION now at v${{ inputs.version }}"
git push origin "$MAJOR_VERSION" --force
echo "🌟 Star collected! $MAJOR_VERSION is now super-charged!"
Expand All @@ -105,25 +105,25 @@ jobs:
name: "🔑 Secret Key Level v${{ inputs.version }}"
body: |
## 🔑 Envilder GitHub Action - Level v${{ inputs.version }}

🎮 **New power-up unlocked!** Pull secrets from AWS SSM like collecting coins! 🪙

### 🍄 How to use this power-up

```yaml
- uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1

- uses: macalbert/envilder@v${{ inputs.version }}
with:
map-file: param-map.json
env-file: .env
```

📖 Check the [manual](https://github.com/macalbert/envilder/blob/main/docs/github-action.md) to master this level!

🎊 **Let's-a-go!**
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🔑 Key Chest Test

permissions:
id-token: write # Required for OIDC authentication with AWS
id-token: write # Required for OIDC authentication with AWS
contents: read

on:
Expand Down Expand Up @@ -44,8 +44,8 @@ jobs:
- name: 🍄 Grab a Mushroom (Setup Node.js with Cache)
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 🪙 Collect Coins (Configure AWS credentials)
uses: aws-actions/configure-aws-credentials@v5
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🍄 1-Up Test Run

permissions:
id-token: write # Required for OIDC authentication with AWS
id-token: write # Required for OIDC authentication with AWS
checks: write
pull-requests: write
contents: read
Expand All @@ -22,10 +22,10 @@ on:
- \"github-action/action.yml\"
- \"src/**\"
- \"tests/**\"
- 'package.json'
- 'pnpm-lock.yaml'
- 'tsconfig.json'
- 'vite.config.ts'
- "package.json"
- "pnpm-lock.yaml"
- "tsconfig.json"
- "vite.config.ts"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
Expand All @@ -49,8 +49,8 @@ jobs:
- name: 🍄 Grab a Mushroom (Setup Node.js with Cache)
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 🪙 Collect Coins (Configure AWS credentials)
uses: aws-actions/configure-aws-credentials@v5
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/verify-action-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: 🔍 Verify Action Build
on:
pull_request:
paths:
- 'src/apps/gha/**'
- 'github-action/**'
- '.github/workflows/verify-action-build.yml'
- "src/apps/gha/**"
- "github-action/**"
- ".github/workflows/verify-action-build.yml"

jobs:
verify-build:
runs-on: ubuntu-24.04
timeout-minutes: 10

steps:
- name: 🧱 Checkout
uses: actions/checkout@v6
Expand All @@ -24,8 +24,8 @@ jobs:
- name: 🍄 Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
12 changes: 6 additions & 6 deletions docs/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
- name: 🍄 Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 📦 Install Dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -135,8 +135,8 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- run: pnpm build
Expand Down Expand Up @@ -208,8 +208,8 @@ steps:

- uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 📦 Install and Build Envilder
run: |
Expand Down
27 changes: 27 additions & 0 deletions e2e/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,33 @@ describe('Envilder (E2E)', () => {
const ssmValue = await GetParameterSsm(singleSsmPath);
expect(ssmValue).toBe(value);
});

it('Should_SuccessfullyPushAllVariables_When_AllParametersAreValid', async () => {
// Arrange
const params = ['--push', '--envfile', envFilePath, '--map', mapFilePath];

const ssmParams = JSON.parse(readFileSync(mapFilePath, 'utf8')) as Record<
string,
string
>;

// Act
const actual = await runCommand(envilder, params);

// Assert
expect(actual.code).toBe(0);
expect(actual.output).toContain(
'Successfully pushed environment variables',
);
expect(actual.output).not.toContain('Failed to push environment file');
expect(actual.output).not.toContain('Unknown');

for (const [key, ssmPath] of Object.entries(ssmParams)) {
const expectedValue = GetSecretFromKey(envFilePath, key);
const ssmValue = await GetParameterSsm(ssmPath);
expect(ssmValue).toBe(expectedValue);
}
});
});

function runCommand(
Expand Down
4 changes: 2 additions & 2 deletions github-action/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ jobs:
- name: 🍄 Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'pnpm'
node-version: "20.x"
cache: "pnpm"

- name: 📦 Install Dependencies
run: pnpm install --frozen-lockfile
Expand Down
Loading