-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
46 lines (46 loc) · 1.3 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
name: "Sls mentor "
description: "run sls-mentor"
inputs:
level:
description: "Sls-mentor level"
required: false
default: "1"
type: string
iam-role:
description: "IAM role to assume"
required: true
type: string
iam-role-session-name:
description: "IAM role session name"
required: false
default: "sls-mentor"
type: string
aws-region:
description: "AWS region"
required: false
default: "eu-west-1"
type: string
runs:
using: "composite"
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{inputs.iam-role}}
role-session-name: ${{inputs.iam-role-session-name}}
aws-region: ${{inputs.aws-region}}
- name: "sls-mentor-run"
id: sls-mentor-run
run: |
echo "SLS_MENTOR_RESULT<<EOF"$'\n'"$(npx sls-mentor@latest --level 1 --noFail)"$'\n'EOF >> "$GITHUB_ENV"
shell: bash
- uses: actions/github-script@v6
with:
script: |
const output = `Sls-mentor result: ${process.env.SLS_MENTOR_RESULT}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: output
});