-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
67 lines (62 loc) · 1.89 KB
/
action.yaml
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
name: AWS API Gateway Request with OIDC
description: GitHub Action to make AWS SigV4 requests to API Gateway using OIDC
branding:
icon: cloud
color: orange
inputs:
aws-role-to-assume:
description: AWS IAM role arn to assume via OIDC
required: true
aws-region:
description: AWS region name
required: true
url:
description: AWS API Gateway URL
required: true
method:
description: Request method - GET, POST, PUT, etc
required: false
default: GET
headers:
description: Request headers in multi-line key/value string format
required: false
payload:
description: Request body payload in JSON string format
required: false
max-retries:
description: Number of times to retry the request
required: false
default: 0
outputs:
status-code:
description: response status code
value: ${{ steps.api-request.outputs.status-code }}
headers:
description: response headers
value: ${{ steps.api-request.outputs.headers }}
body:
description: response body
value: ${{ steps.api-request.outputs.body }}
runs:
using: composite
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ inputs.aws-role-to-assume }}
aws-region: ${{ inputs.aws-region }}
- uses: actions/setup-node@v4
with:
node-version: 16
- name: API Gateway request
id: api-request
shell: bash
working-directory: ${{ github.action_path }}
env: # composite action inputs are not set as env vars https://github.com/actions/runner/issues/665
INPUT_AWS-REGION: ${{ inputs.aws-region }}
INPUT_URL: ${{ inputs.url }}
INPUT_METHOD: ${{ inputs.method }}
INPUT_HEADERS: ${{ inputs.headers }}
INPUT_PAYLOAD: ${{ inputs.payload }}
INPUT_MAX-RETRIES: ${{ inputs.max-retries }}
run: node dist/index.js