-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
84 lines (82 loc) · 2.55 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: ECR Scan
branding:
icon: arrow-right-circle
color: gray-dark
description: |
This action scans ecr scan result and reports results back to pr
inputs:
debug-mode:
description: Set to true for verbose execution when debugging
required: false
default: 'false'
log-level:
description: The log level to use for the execution
required: false
default: 'info'
log-timestamped:
description: Set to true in order to enable timestamps on log messages
required: false
default: 'true'
role-to-assume:
required: true
description: 'aws role-to-assume to configure'
role-session-name:
required: true
description: 'aws role-session-name to configure'
aws-region:
description: AWS region to run in
required: true
aws-account-id:
description: AWS account ID to use for ECR repo
required: true
ecr-repo-name:
description: AWS ECR Repo Name to use to view scan
required: true
ecr-repo-tag:
description: AWS ECR Repo image tag to use to view scan
required: true
use-alpha:
description: AWS ECR Repo Alpha image
required: false
default: 'true'
pr-number:
description: The current pull request number
required: true
sso-prefix:
description: The prefix for the SSO account
required: true
sso-role:
description: The role to assume in the SSO account
required: true
runs:
using: 'composite'
steps:
- name: setup
if: github.event_name == 'pull_request'
shell: bash
id: setup
run: |
echo "scripts-path=${GITHUB_ACTION_PATH}" >>"${GITHUB_OUTPUT}"
- name: Configure AWS credentials
if: github.event_name == 'pull_request'
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ inputs.role-to-assume }}
role-session-name: ${{ inputs.role-session-name }}
aws-region: ${{ inputs.aws-region }}
- name: Scan ECR
if: github.event_name == 'pull_request'
run: '${{ steps.setup.outputs.scripts-path }}/scripts/script.sh'
shell: bash
env:
DEBUG_MODE: ${{ inputs.debug-mode }}
LOG_LEVEL: ${{ inputs.log-level }}
LOG_TIMESTAMPED: ${{ inputs.log-timestamped }}
AWS_ACCOUNT_ID: ${{ inputs.aws-account-id }}
AWS_REGION: ${{ inputs.aws-region }}
ECR_REPO_NAME: ${{ inputs.ecr-repo-name }}
ECR_REPO_TAG: ${{ inputs.ecr-repo-tag }}
USE_ALPHA_REGISTRY: ${{ inputs.use-alpha }}
PR_NUMBER: ${{ inputs.pr-number }}
SSO_PREFIX: ${{ inputs.sso-prefix }}
SSO_ROLE: ${{ inputs.sso-role }}