Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Far away region test #13

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Builds
description: Builds the repository and assumes the AWS IAM role for testing
inputs:
aws-region:
description: Region where the credentials will be assumed
required: false
default: us-east-1
runs:
using: composite
steps:
Expand All @@ -24,4 +29,4 @@ runs:
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ steps.role-to-assume.outputs.arn }}
aws-region: us-east-1
aws-region: ${{ inputs.aws-region }}
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,20 @@ jobs:
secret-ids: JsonSecret
- name: Assert Default Is No Json Secrets
run: npm run integration-test __integration_tests__/parse_json_secrets.test.ts

af-south-1-integration-test:
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: ./.github/actions/build
with:
aws-region: af-south-1
- name: Act
uses: ./
with:
secret-ids: JsonSecret
- name: Assert
run: npm run integration-test __integration_tests__/parse_json_secrets.test.ts
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ inputs:
runs:
using: 'node20'
main: 'dist/index.js'
post: 'dist/cleanup/index.js'
post: 'dist/cleanup/index.js'
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as core from '@actions/core'
import * as core from '@actions/core';
import { setDefaultAutoSelectFamilyAttemptTimeout } from 'net';
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
import {
buildSecretsList,
Expand All @@ -13,6 +14,8 @@ import { CLEANUP_NAME } from "./constants";

export async function run(): Promise<void> {
try {
setDefaultAutoSelectFamilyAttemptTimeout(1000);

// Default client region is set by configure-aws-credentials
const client : SecretsManagerClient = new SecretsManagerClient({region: process.env.AWS_DEFAULT_REGION, customUserAgent: "github-action"});
const secretConfigInputs: string[] = [...new Set(core.getMultilineInput('secret-ids'))];
Expand Down