Skip to content

Commit 1ef9189

Browse files
authored
chore: add composite action for container pull (#5487)
* chore: add composite action for container pull Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com> * chore: use composite for docker pull Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com> --------- Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com>
1 parent dfd408d commit 1ef9189

File tree

4 files changed

+154
-190
lines changed

4 files changed

+154
-190
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Container Cleanup
2+
description: Remove container via container ID and clean up image caches.
3+
4+
inputs:
5+
container_id:
6+
description: Container ID to be removed
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Cleanup container and images
13+
shell: bash
14+
run: |
15+
docker rm -f ${{ inputs.container_id }} || true
16+
docker image prune -a --force --filter "until=24h"
17+
docker system df
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: ECR Authentication
2+
description: Login to ECR, if image_uri is provided pull the image onto host runner.
3+
4+
inputs:
5+
aws_region:
6+
description: AWS Region for docker image repository
7+
required: true
8+
aws_account_id:
9+
description: AWS Account ID for docker image registry
10+
required: true
11+
image_uri:
12+
description: Docker image URI to pull from ECR
13+
required: false
14+
15+
runs:
16+
using: composite
17+
steps:
18+
19+
- name: ECR login
20+
shell: bash
21+
run: |
22+
aws ecr get-login-password --region ${{ inputs.aws_region }} | docker login --username AWS --password-stdin ${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com
23+
24+
- name: Pull image
25+
if: inputs.image_uri != ''
26+
shell: bash
27+
run: |
28+
docker pull ${{ inputs.image_uri }}

.github/actions/pr-permission-gate/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: PR Permission Gate
2-
description: Fails the workflow if the PR sender lacks the required repository permission
2+
description: Fails the workflow if the PR sender lacks the required repository permission.
33
inputs:
44
required-level:
55
description: Minimum permission level required (read|triage|write|maintain|admin)

0 commit comments

Comments
 (0)