-
Notifications
You must be signed in to change notification settings - Fork 4
118 lines (117 loc) · 4.08 KB
/
example.yml
File metadata and controls
118 lines (117 loc) · 4.08 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: example
on:
push:
branches:
- main
jobs:
job:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get DynamoDB Item
id: config
uses: step-security/dynamodb-actions@0b116fa64bf24e8baef26c12b3bc548a91c61f51 # v1.2.3
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
operation: get
region: us-west-2
table: dynamodb-actions-test
key: |
{ key: "foo" }
consistent: false
- name: Print item
run: |
echo '${{ steps.config.outputs.item }}'
- name: Print specific field using built-in function
run: |
echo '${{ fromJson(steps.config.outputs.item).commit }}'
- name: Print specific field using jq
run: |
jq '.commit' <<< '${{ steps.config.outputs.item }}'
- name: Delete DynamoDB Item
uses: step-security/dynamodb-actions@0b116fa64bf24e8baef26c12b3bc548a91c61f51 # v1.2.3
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
operation: delete
region: us-west-2
table: dynamodb-actions-test
key: |
{ key: "foo" }
- name: Put DynamoDB Item (JSON input)
uses: step-security/dynamodb-actions@0b116fa64bf24e8baef26c12b3bc548a91c61f51 # v1.2.3
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
operation: put
region: us-west-2
table: dynamodb-actions-test
item: |
{
key: "foo",
commit: "${{ github.sha }}",
value: "wow",
awesome: true,
stars: 12345
}
- name: Put DynamoDB Item (File Input)
uses: step-security/dynamodb-actions@0b116fa64bf24e8baef26c12b3bc548a91c61f51 # v1.2.3
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
operation: put
region: us-west-2
table: dynamodb-actions-test
file: fixtures/item.json
- name: BatchPut DynamoDB Item (JSON input)
uses: step-security/dynamodb-actions@0b116fa64bf24e8baef26c12b3bc548a91c61f51 # v1.2.3
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
operation: batch-put
region: us-west-2
table: dynamodb-actions-test
items: |
[{
key: "foo",
commit: "${{ github.sha }}",
value: "wow",
awesome: true,
stars: 12345
}, {
key: "bar",
value: "baz"
}]
- name: BatchPut DynamoDB Item (File Input)
uses: step-security/dynamodb-actions@0b116fa64bf24e8baef26c12b3bc548a91c61f51 # v1.2.3
env:
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
operation: batch-put
region: us-west-2
table: dynamodb-actions-test
files: fixtures/*.json