Skip to content

Commit a9b5106

Browse files
committed
bump up to v1.7.0
1 parent 9a7a892 commit a9b5106

File tree

184 files changed

+29752
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+29752
-57
lines changed

action/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
/node_modules/
2-
/lib/
31
/dummy.log

action/lib/index.js

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ const core = __importStar(require("@actions/core"));
2828
const http = __importStar(require("@actions/http-client"));
2929
function validateGitHubToken(token) {
3030
if (token.length < 4) {
31-
throw new Error('GITHUB_TOKEN has invalid format');
31+
throw new Error("GITHUB_TOKEN has invalid format");
3232
}
3333
switch (token.substring(0, 4)) {
34-
case 'ghp_':
34+
case "ghp_":
3535
// Personal Access Tokens
36-
throw new Error('GITHUB_TOKEN looks like Personal Access Token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.');
37-
case 'gho_':
36+
throw new Error("GITHUB_TOKEN looks like Personal Access Token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.");
37+
case "gho_":
3838
// OAuth Access tokens
39-
throw new Error('GITHUB_TOKEN looks like OAuth Access token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.');
40-
case 'ghu_':
39+
throw new Error("GITHUB_TOKEN looks like OAuth Access token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.");
40+
case "ghu_":
4141
// GitHub App user-to-server tokens
42-
throw new Error('GITHUB_TOKEN looks like GitHub App user-to-server token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.');
43-
case 'ghs_':
42+
throw new Error("GITHUB_TOKEN looks like GitHub App user-to-server token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.");
43+
case "ghs_":
4444
// GitHub App server-to-server tokens
4545
return; // it's OK
46-
case 'ghr_':
47-
throw new Error('GITHUB_TOKEN looks like GitHub App refresh token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.');
46+
case "ghr_":
47+
throw new Error("GITHUB_TOKEN looks like GitHub App refresh token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.");
4848
}
4949
// maybe Old Format Personal Access Tokens
50-
throw new Error('GITHUB_TOKEN looks like Personal Access Token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.');
50+
throw new Error("GITHUB_TOKEN looks like Personal Access Token. `github-token` must be `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}`.");
5151
}
5252
// comes from the article "AWS federation comes to GitHub Actions"
5353
// https://awsteele.com/blog/2021/09/15/aws-federation-comes-to-github-actions.html
5454
function isIdTokenAvailable() {
55-
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
56-
const url = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
55+
const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];
56+
const url = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];
5757
return token && url ? true : false;
5858
}
5959
function assertIsDefined(val) {
@@ -69,7 +69,7 @@ async function assumeRole(params) {
6969
assertIsDefined(GITHUB_ACTOR);
7070
assertIsDefined(GITHUB_SHA);
7171
validateGitHubToken(params.githubToken);
72-
const GITHUB_API_URL = process.env['GITHUB_API_URL'] || 'https://api.github.com';
72+
const GITHUB_API_URL = process.env["GITHUB_API_URL"] || "https://api.github.com";
7373
let idToken;
7474
if (isIdTokenAvailable()) {
7575
idToken = await core.getIDToken();
@@ -83,15 +83,14 @@ async function assumeRole(params) {
8383
api_url: GITHUB_API_URL,
8484
repository: GITHUB_REPOSITORY,
8585
use_node_id: params.useNodeId,
86-
obfuscate_repository: params.obfuscateRepository,
8786
sha: GITHUB_SHA,
8887
role_session_tagging: params.roleSessionTagging,
8988
run_id: GITHUB_RUN_ID,
9089
workflow: GITHUB_WORKFLOW,
9190
actor: GITHUB_ACTOR,
92-
branch: GITHUB_REF || ''
91+
branch: GITHUB_REF || "",
9392
};
94-
const client = new http.HttpClient('actions-aws-assume-role');
93+
const client = new http.HttpClient("actions-aws-assume-role");
9594
const result = await client.postJson(params.providerEndpoint, payload);
9695
if (result.statusCode !== 200) {
9796
const resp = result.result;
@@ -106,29 +105,28 @@ async function assumeRole(params) {
106105
core.warning(resp.warning);
107106
}
108107
core.setSecret(resp.access_key_id);
109-
core.exportVariable('AWS_ACCESS_KEY_ID', resp.access_key_id);
108+
core.exportVariable("AWS_ACCESS_KEY_ID", resp.access_key_id);
110109
core.setSecret(resp.secret_access_key);
111-
core.exportVariable('AWS_SECRET_ACCESS_KEY', resp.secret_access_key);
110+
core.exportVariable("AWS_SECRET_ACCESS_KEY", resp.secret_access_key);
112111
core.setSecret(resp.session_token);
113-
core.exportVariable('AWS_SESSION_TOKEN', resp.session_token);
114-
core.exportVariable('AWS_DEFAULT_REGION', params.awsRegion);
115-
core.exportVariable('AWS_REGION', params.awsRegion);
112+
core.exportVariable("AWS_SESSION_TOKEN", resp.session_token);
113+
core.exportVariable("AWS_DEFAULT_REGION", params.awsRegion);
114+
core.exportVariable("AWS_REGION", params.awsRegion);
116115
}
117116
exports.assumeRole = assumeRole;
118117
async function run() {
119118
try {
120119
const required = {
121-
required: true
120+
required: true,
122121
};
123-
const githubToken = core.getInput('github-token', required);
124-
const awsRegion = core.getInput('aws-region', required);
125-
const roleToAssume = core.getInput('role-to-assume', required);
126-
const roleDurationSeconds = Number.parseInt(core.getInput('role-duration-seconds', required));
127-
const roleSessionName = core.getInput('role-session-name', required);
128-
const roleSessionTagging = core.getBooleanInput('role-session-tagging', required);
129-
const providerEndpoint = core.getInput('provider-endpoint') || 'https://uw4qs7ndjj.execute-api.us-east-1.amazonaws.com/assume-role';
130-
const useNodeId = core.getBooleanInput('use-node-id', required);
131-
const obfuscateRepository = core.getInput('obfuscate-repository');
122+
const githubToken = core.getInput("github-token", required);
123+
const awsRegion = core.getInput("aws-region", required);
124+
const roleToAssume = core.getInput("role-to-assume", required);
125+
const roleDurationSeconds = Number.parseInt(core.getInput("role-duration-seconds", required));
126+
const roleSessionName = core.getInput("role-session-name", required);
127+
const roleSessionTagging = core.getBooleanInput("role-session-tagging", required);
128+
const providerEndpoint = core.getInput("provider-endpoint") || "https://uw4qs7ndjj.execute-api.us-east-1.amazonaws.com/assume-role";
129+
const useNodeId = core.getBooleanInput("use-node-id", required);
132130
if (roleDurationSeconds <= 0 || roleDurationSeconds > 60 * 60) {
133131
core.setFailed(`invalid role-duration-seconds ${roleDurationSeconds}, it should be from 1 to 3600`);
134132
}
@@ -141,7 +139,6 @@ async function run() {
141139
roleSessionTagging,
142140
providerEndpoint,
143141
useNodeId,
144-
obfuscateRepository
145142
});
146143
}
147144
catch (error) {

action/node_modules/@actions/core/README.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/core/lib/core.d.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/core/lib/oidc-utils.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/core/lib/oidc-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/core/package.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/http-client/lib/index.d.ts

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/http-client/lib/index.js

Lines changed: 43 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/node_modules/@actions/http-client/lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)