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

Remove remaining SDKv2 code #26

Merged
merged 1 commit into from
Jul 5, 2024
Merged
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
Remove remaining SDKv2 code
  • Loading branch information
Ic3w0lf committed Jul 5, 2024
commit e31ad440f7283e829c84005a767e03785c78595f
3,653 changes: 3,086 additions & 567 deletions dist/index.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const core = require('@actions/core');
const aws = require('aws-sdk');

const {loadConfig} = require("@aws-sdk/node-config-provider");
const {NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS} = require("@aws-sdk/config-resolver");
const {ECS, waitUntilTasksRunning, waitUntilTasksStopped} = require('@aws-sdk/client-ecs');

const smoketail = require('smoketail')
@@ -197,7 +198,9 @@ const main = async () => {

// Get exitCode
if (task.tasks[0].containers[0].exitCode !== 0) {
core.info(`Task failed, see details on Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=${aws.config.region}#/clusters/${cluster}/tasks/${taskId}/details`);
const currentRegion = await loadConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS)();

core.info(`Task failed, see details on Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=${currentRegion}#/clusters/${cluster}/tasks/${taskId}/details`);
core.setFailed(task.tasks[0].stoppedReason)
}
} catch (error) {
140 changes: 132 additions & 8 deletions package-lock.json
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@
"dependencies": {
"@actions/core": "^1.9.1",
"@aws-sdk/client-ecs": "^3.609.0",
"aws-sdk": "^2.1244.0",
"@aws-sdk/config-resolver": "^3.374.0",
"@aws-sdk/node-config-provider": "^3.374.0",
"smoketail": "^0.2.2",
"yaml": "^2.2.2"
},