mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-03-12 18:07:10 -04:00
* chore(deps-dev): bump @biomejs/biome from 1.9.4 to 2.1.2 Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.9.4 to 2.1.2. - [Release notes](https://github.com/biomejs/biome/releases) - [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md) - [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.1.2/packages/@biomejs/biome) --- updated-dependencies: - dependency-name: "@biomejs/biome" dependency-version: 2.1.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore: bump biome and fix linting errors --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kellertk <kellertk@amazon.com> Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
115 lines
3.3 KiB
TypeScript
115 lines
3.3 KiB
TypeScript
import type * as core from '@actions/core';
|
|
|
|
const inputs = {
|
|
GH_OIDC_INPUTS: {
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
'aws-region': 'fake-region-1',
|
|
'special-characters-workaround': 'true',
|
|
},
|
|
IAM_USER_INPUTS: {
|
|
'aws-access-key-id': 'MYAWSACCESSKEYID',
|
|
'aws-secret-access-key': 'MYAWSSECRETACCESSKEY',
|
|
'aws-region': 'fake-region-1',
|
|
},
|
|
IAM_ASSUMEROLE_INPUTS: {
|
|
'aws-access-key-id': 'MYAWSACCESSKEYID',
|
|
'aws-secret-access-key': 'MYAWSSECRETACCESSKEY',
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
'aws-region': 'fake-region-1',
|
|
},
|
|
WEBIDENTITY_TOKEN_FILE_INPUTS: {
|
|
'web-identity-token-file': 'file.txt',
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
'aws-region': 'fake-region-1',
|
|
},
|
|
EXISTING_ROLE_INPUTS: {
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
'role-chaining': 'true',
|
|
'aws-region': 'fake-region-1',
|
|
},
|
|
USE_EXISTING_CREDENTIALS_INPUTS: {
|
|
'aws-region': 'fake-region-1',
|
|
'use-existing-credentials': 'true',
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
},
|
|
NO_ENV_CREDS_INPUTS: {
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
'aws-region': 'fake-region-1',
|
|
'output-env-credentials': 'false',
|
|
},
|
|
STEP_BUT_NO_ENV_INPUTS: {
|
|
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
'aws-region': 'fake-region-1',
|
|
'output-env-credentials': 'false',
|
|
'output-credentials': 'true',
|
|
},
|
|
};
|
|
|
|
const envs = {
|
|
GITHUB_REPOSITORY: 'MY-REPOSITORY-NAME',
|
|
GITHUB_WORKFLOW: 'MY-WORKFLOW-ID',
|
|
GITHUB_ACTION: 'MY-ACTION-NAME',
|
|
GITHUB_ACTOR: 'MY-USERNAME[bot]',
|
|
GITHUB_SHA: 'MY-COMMIT-ID',
|
|
GITHUB_WORKSPACE: '/home/github',
|
|
GITHUB_ACTIONS: 'true',
|
|
};
|
|
|
|
const outputs = {
|
|
STS_CREDENTIALS: {
|
|
Credentials: {
|
|
AccessKeyId: 'STSAWSACCESSKEYID',
|
|
SecretAccessKey: 'STSAWSSECRETACCESSKEY',
|
|
SessionToken: 'STSAWSSESSIONTOKEN',
|
|
Expiration: new Date(8640000000000000),
|
|
},
|
|
AssumedRoleUser: {
|
|
Arn: 'arn:aws:sts::111111111111:assumed-role/MY-ROLE/',
|
|
AssumedRoleId: 'AROAFAKEASSUMEDROLEID',
|
|
},
|
|
},
|
|
GET_CALLER_IDENTITY: {
|
|
Account: '111111111111',
|
|
Arn: 'arn:aws:iam::111111111111:role/MY-ROLE',
|
|
},
|
|
FAKE_STS_ACCESS_KEY_ID: 'STSAWSACCESSKEYID',
|
|
FAKE_STS_SECRET_ACCESS_KEY: 'STSAWSSECRETACCESSKEY',
|
|
FAKE_STS_SESSION_TOKEN: 'STSAWSSESSIONTOKEN',
|
|
ODD_CHARACTER_CREDENTIALS: {
|
|
Credentials: {
|
|
AccessKeyId: 'STSA#$%^&',
|
|
SecretAccessKey: 'STSA#$%^&Key',
|
|
SessionToken: 'STSA#$%^',
|
|
Expiration: new Date(8640000000000000),
|
|
},
|
|
AssumedRoleUser: {
|
|
Arn: 'arn:aws:sts::111111111111:assumed-role/MY-ROLE/',
|
|
AssumedRoleId: 'AROAFAKEASSUMEDROLEID',
|
|
},
|
|
},
|
|
};
|
|
|
|
export default {
|
|
getInput: (fakeEnv: Record<string, string>) => {
|
|
return (name: string, options?: core.InputOptions): string => {
|
|
if (!fakeEnv[name]) {
|
|
if (options?.required) throw new Error(`Input ${name} not found`);
|
|
return '';
|
|
}
|
|
return fakeEnv[name];
|
|
};
|
|
},
|
|
getMultilineInput: (fakeEnv: Record<string, string[]>) => {
|
|
return (name: string, options?: core.InputOptions): string[] => {
|
|
if (!fakeEnv[name]) {
|
|
if (options?.required) throw new Error(`Input ${name} not found`);
|
|
return [];
|
|
}
|
|
return fakeEnv[name];
|
|
};
|
|
},
|
|
...inputs,
|
|
outputs,
|
|
envs,
|
|
} as const;
|