{"id":19978356,"url":"https://github.com/geekcell/github-action-aws-ecs-run-task","last_synced_at":"2025-07-31T06:07:05.825Z","repository":{"id":62657674,"uuid":"561442602","full_name":"geekcell/github-action-aws-ecs-run-task","owner":"geekcell","description":"Run an AWS ECS Fargate task.","archived":false,"fork":false,"pushed_at":"2025-02-18T13:40:22.000Z","size":6872,"stargazers_count":24,"open_issues_count":1,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-29T18:47:18.988Z","etag":null,"topics":["aws","ecs","fargate","github-actions"],"latest_commit_sha":null,"homepage":"https://www.geekcell.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geekcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-03T17:43:54.000Z","updated_at":"2025-06-12T14:31:23.000Z","dependencies_parsed_at":"2024-06-25T14:14:30.925Z","dependency_job_id":"acedabf2-415b-4c8e-8889-faaa80023947","html_url":"https://github.com/geekcell/github-action-aws-ecs-run-task","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"5ed0126a10c1a078f6210ec6cb469c1eb03c71b6"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/geekcell/github-action-aws-ecs-run-task","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekcell%2Fgithub-action-aws-ecs-run-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekcell%2Fgithub-action-aws-ecs-run-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekcell%2Fgithub-action-aws-ecs-run-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekcell%2Fgithub-action-aws-ecs-run-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geekcell","download_url":"https://codeload.github.com/geekcell/github-action-aws-ecs-run-task/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekcell%2Fgithub-action-aws-ecs-run-task/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267997149,"owners_count":24178249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":["aws","ecs","fargate","github-actions"],"created_at":"2024-11-13T03:33:08.458Z","updated_at":"2025-07-31T06:07:05.818Z","avatar_url":"https://github.com/geekcell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)\n\n[![Linter](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/linter.yaml/badge.svg)](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/linter.yaml)\n[![Test](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/test.yaml/badge.svg)](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/test.yaml)\n[![Check dist/](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/check-dist.yaml/badge.svg)](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/check-dist.yaml)\n\n\u003c!-- action-docs-description --\u003e\n## Description\n\nRun an AWS ECS Fargate task and execute a custom commands. See the log output of the commands.\n\u003c!-- action-docs-description --\u003e\n\n### Details\nThis action makes it possible to run an AWS ECS Fargate task and execute custom commands. If the task definition\nis configured to log to CloudWatch, this action will try to tail the output of container, providing instant feedback inside\nthe GitHub Workflow.\n\nThis action is great for executing migrations or other pre/post deployment steps for ECS Fargate applications.\n\n## Usage\n\n#### Full example\n``` yaml\n- name: Execute migrations and seeders\n  id: run-task\n  uses: geekcell/github-action-aws-ecs-run-task@v3.0.0\n  with:\n    cluster: application-cluster\n    task-definition: application-task-def\n    assign-public-ip: 'DISABLED'\n\n    subnet-ids: |\n      subnet-04f133a104b9e95df\n      subnet-0dc419ee6a1483514\n\n    security-group-ids: |\n      sg-123456789101112\n      sg-112398765421333\n\n    tail-logs: true\n    override-container: app\n    override-container-command: |\n      /bin/sh\n      -c\n      php artisan migrate --force --ansi \u0026\u0026 php artisan db:seed --force --ansi\n    override-container-environment: |\n      AWS_REGION=us-east-1\n      FOO=baz\n\n    task-wait-until-stopped: true\n    task-start-max-wait-time: 120\n    task-stopped-max-wait-time: 300\n```\n\n#### Minimal example\n``` yaml\n- name: Run migration container\n  id: run-task\n  uses: geekcell/github-action-aws-ecs-run-task@v3.0.0\n  with:\n    cluster: application-cluster\n    task-definition: application-task-def\n    subnet-ids: subnet-04f133a104b9e95df\n    security-group-ids: sg-123456789101112\n```\n\n#### Appending multiple lines into a single command\n\nYou can use the backslash character `\\` to append multiple lines into a single line. This is useful if you have many\ncommands to execute and want to keep the YAML file readable. Otherwise, each line will be passed to the AWS ECS Fargate\ntask as a separate argument.\n\n\u003e **Note:** Make sure to use the `|` character so the YAML parser interprets the value as a multiline string.\n\u003e You can read more about this in the [YAML documentation](https://yaml.org/spec/1.2/spec.html#id2794534).\n\nFor example:\n\n``` yaml\n...\noverride-container-command: |\n  /bin/sh\n  -c\n  php artisan down \u0026\u0026 \\\n  php artisan migrate --force --ansi \u0026\u0026 \\\n  php artisan db:seed --force --ansi \u0026\u0026 \\\n  php artisan cache:clear --ansi\n```\n\nWill pass the following command to the container on the AWS ECS Fargate task:\n```\n[\"sh\", \"-c\", \"php artisan down \u0026\u0026 php artisan migrate --force --ansi \u0026\u0026 php artisan db:seed --force --ansi \u0026\u0026 php artisan cache:clear --ansi\"]\n```\n\n\u003c!-- action-docs-inputs --\u003e\n## Inputs\n\n| parameter | description | required | default |\n| --- | --- | --- | --- |\n| task-definition | The name or the ARN of the task definition to use for the task. | `true` |  |\n| subnet-ids | The list of subnet IDs for the task to use. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` |  |\n| security-group-ids | List of security group IDs for the task. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` |  |\n| assign-public-ip | Assign public a IP to the task. Options: `['ENABLED', 'DISABLED']` | `false` | DISABLED |\n| cluster | Which ECS cluster to start the task in. | `false` |  |\n| override-container | Will use `containerOverrides` to run a custom command on the container. If provided, `override-container-command` must also be set. | `false` |  |\n| override-container-command | The command to run on the container if `override-container` is passed. | `false` |  |\n| override-container-environment | Add or override existing environment variables if `override-container` is passed. Provide one per line in key=value format. | `false` |  |\n| tail-logs | If set to true, will try to extract the logConfiguration for the first container in the task definition. If `override-container` is passed, it will extract the logConfiguration from that container. Tailing logs is only possible if the provided container uses the `awslogs` logDriver. | `false` | true |\n| task-wait-until-stopped | Whether to wait for the task to stop before finishing the action. If set to false, the action will finish immediately after the task reaches the `RUNNING` state (fire and forget). | `false` | true |\n| task-start-max-wait-time | How long to wait for the task to start (i.e. reach the `RUNNING` state) in seconds. If the task does not start within this time, the pipeline will fail. | `false` | 120 |\n| task-stop-max-wait-time | How long to wait for the task to stop (i.e. reach the `STOPPED` state) in seconds. The task will not be canceled after this time, the pipeline will just be marked as failed. | `false` | 300 |\n| task-check-state-delay | How long to wait between each AWS API call to check the current state of the task in seconds. This is useful to avoid running into AWS rate limits. **However**, setting this too high might cause the Action to miss the time-window your task is in the \"RUNNING\" state (if you task is very short lived) and can cause the action to fail. | `false` | 6 |\n\u003c!-- action-docs-inputs --\u003e\n\n\u003c!-- action-docs-outputs --\u003e\n## Outputs\n\n| parameter | description |\n| --- | --- |\n| task-arn | The full ARN for the task that was ran. |\n| task-id | The ID for the task that was ran. |\n| log-output | The log output of the task that was ran, if `tail-logs` and `task-wait-until-stopped` are set to true. |\n\u003c!-- action-docs-outputs --\u003e\n\n\u003c!-- action-docs-runs --\u003e\n## Runs\n\nThis action is a `node20` action.\n\u003c!-- action-docs-runs --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekcell%2Fgithub-action-aws-ecs-run-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekcell%2Fgithub-action-aws-ecs-run-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekcell%2Fgithub-action-aws-ecs-run-task/lists"}