{"id":49534047,"url":"https://github.com/researchsquare/run-ecs-task-action","last_synced_at":"2026-05-02T09:03:33.345Z","repository":{"id":37564822,"uuid":"308803738","full_name":"researchsquare/run-ecs-task-action","owner":"researchsquare","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-07T19:41:38.000Z","size":3068,"stargazers_count":1,"open_issues_count":8,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-03-27T16:43:29.329Z","etag":null,"topics":["sre"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/researchsquare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-31T04:32:41.000Z","updated_at":"2023-07-18T09:03:29.000Z","dependencies_parsed_at":"2023-02-16T22:16:04.877Z","dependency_job_id":null,"html_url":"https://github.com/researchsquare/run-ecs-task-action","commit_stats":{"total_commits":63,"total_committers":22,"mean_commits":"2.8636363636363638","dds":0.4126984126984127,"last_synced_commit":"b430248b9aa145a4b474116ea55779c8e61158d0"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/researchsquare/run-ecs-task-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchsquare%2Frun-ecs-task-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchsquare%2Frun-ecs-task-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchsquare%2Frun-ecs-task-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchsquare%2Frun-ecs-task-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/researchsquare","download_url":"https://codeload.github.com/researchsquare/run-ecs-task-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchsquare%2Frun-ecs-task-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32528665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sre"],"created_at":"2026-05-02T09:03:18.880Z","updated_at":"2026-05-02T09:03:33.339Z","avatar_url":"https://github.com/researchsquare.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Run ECS Task Action for GitHub Actions\n\nRuns a one off task on an ECS cluster.\n\n**Table of Contents**\n\n\u003c!-- toc --\u003e\n\n- [Usage](#usage)\n    + [Sample workflow](#sample-workflow)\n- [Credentials and Region](#credentials-and-region)\n- [Permissions](#permissions)\n- [Troubleshooting](#troubleshooting)\n\n\u003c!-- tocstop --\u003e\n\n## Usage\n\n```yaml\n    - name: Run ECS Task\n      uses: researchsquare/run-ecs-task-action@v1\n      with:\n        task-definition: task-definition-arn\n        cluster: my-cluster\n        wait-for-task-completion: true\n```\n\nSee [action.yml](action.yml) for the full documentation for this action's inputs and outputs.\n\n### Sample workflow\n\nThe task definition file can be updated prior to deployment with the new container image ID using [the `aws-actions/amazon-ecs-render-task-definition` action](https://github.com/aws-actions/amazon-ecs-render-task-definition). The following example builds a new container image tagged with the commit ID, inserts the new image ID as the image for the `my-container` container in the task definition file, and then deploys the rendered task definition file to ECS:\n\n```yaml\n    - name: Configure AWS credentials\n      uses: aws-actions/configure-aws-credentials@v1\n      with:\n        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n        aws-region: us-east-2\n\n    - name: Login to Amazon ECR\n      id: login-ecr\n      uses: aws-actions/amazon-ecr-login@v1\n\n    - name: Build, tag, and push image to Amazon ECR\n      id: build-image\n      env:\n        ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}\n        ECR_REPOSITORY: my-ecr-repo\n        IMAGE_TAG: ${{ github.sha }}\n      run: |\n        docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .\n        docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG\n        echo \"::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG\"\n\n    - name: Fill in the new image ID in the Amazon ECS task definition\n      id: task-def\n      uses: aws-actions/amazon-ecs-render-task-definition@v1\n      with:\n        task-definition: task-definition.json\n        container-name: my-container\n        image: ${{ steps.build-image.outputs.image }}\n\n    - name: Create Amazon ECS task definition\n      id: task-creation\n      uses: aws-actions/amazon-ecs-deploy-task-definition@v1\n      with:\n        task-definition: ${{ steps.task-def.outputs.task-definition }}\n\n    - name: Run ECS Task\n      uses: researchsquare/run-ecs-task-action@v1\n      with:\n        task-definition: task-definition-arn\n        cluster: my-cluster\n        wait-for-service-stability: true\n```\n\n## Credentials and Region\n\nThis action relies on the [default behavior of the AWS SDK for Javascript](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html) to determine AWS credentials and region.\nUse [the `aws-actions/configure-aws-credentials` action](https://github.com/aws-actions/configure-aws-credentials) to configure the GitHub Actions environment with environment variables containing AWS credentials and your desired region.\n\nWe recommend following [Amazon IAM best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) for the AWS credentials used in GitHub Actions workflows, including:\n* Do not store credentials in your repository's code.  You may use [GitHub Actions secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) to store credentials and redact credentials from GitHub Actions workflow logs.\n* [Create an individual IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) with an access key for use in GitHub Actions workflows, preferably one per repository. Do not use the AWS account root user access key.\n* [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) to the credentials used in GitHub Actions workflows.  Grant only the permissions required to perform the actions in your GitHub Actions workflows.  See the Permissions section below for the permissions required by this action.\n* [Rotate the credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#rotate-credentials) used in GitHub Actions workflows regularly.\n* [Monitor the activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#keep-a-log) of the credentials used in GitHub Actions workflows.\n\n## Permissions\n\nThis action requires the following minimum set of permissions:\n\n```json\n{\n   \"Version\":\"2012-10-17\",\n   \"Statement\":[\n      {\n         \"Sid\":\"RegisterTaskDefinition\",\n         \"Effect\":\"Allow\",\n         \"Action\":[\n            \"ecs:RegisterTaskDefinition\"\n         ],\n         \"Resource\":\"*\"\n      },\n      {\n         \"Sid\":\"PassRolesInTaskDefinition\",\n         \"Effect\":\"Allow\",\n         \"Action\":[\n            \"iam:PassRole\"\n         ],\n         \"Resource\":[\n            \"arn:aws:iam::\u003caws_account_id\u003e:role/\u003ctask_definition_task_role_name\u003e\",\n            \"arn:aws:iam::\u003caws_account_id\u003e:role/\u003ctask_definition_task_execution_role_name\u003e\"\n         ]\n      },\n      {\n         \"Sid\":\"DeployService\",\n         \"Effect\":\"Allow\",\n         \"Action\":[\n            \"ecs:UpdateService\",\n            \"ecs:DescribeServices\"\n         ],\n         \"Resource\":[\n            \"arn:aws:ecs:\u003cregion\u003e:\u003caws_account_id\u003e:service/\u003ccluster_name\u003e/\u003cservice_name\u003e\"\n         ]\n      }\n   ]\n}\n```\n\nNote: the policy above assumes the account has opted in to the ECS long ARN format.\n\n## Troubleshooting\n\nThis action emits debug logs to help troubleshoot deployment failures.  To see the debug logs, create a secret named `ACTIONS_STEP_DEBUG` with value `true` in your repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresearchsquare%2Frun-ecs-task-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresearchsquare%2Frun-ecs-task-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresearchsquare%2Frun-ecs-task-action/lists"}