Skip to content

Commit 9fe29ff

Browse files
authored
Merge pull request #1 from step-security/staging
first commit
2 parents 98a97d9 + c838607 commit 9fe29ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+12821
-1
lines changed

.github/workflows/example.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: example
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
job:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 5
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Get DynamoDB Item
13+
id: config
14+
uses: step-security/dynamodb-actions@v1
15+
env:
16+
AWS_DEFAULT_REGION: us-east-1
17+
AWS_REGION: us-east-1
18+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
19+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
20+
with:
21+
operation: get
22+
region: us-east-1
23+
table: dynamodb-actions-test
24+
key: |
25+
{ key: "foo" }
26+
consistent: false
27+
- name: Print item
28+
run: |
29+
echo '${{ steps.config.outputs.item }}'
30+
- name: Print specific field using built-in function
31+
run: |
32+
echo '${{ fromJson(steps.config.outputs.item).commit }}'
33+
- name: Print specific field using jq
34+
run: |
35+
jq '.commit' <<< '${{ steps.config.outputs.item }}'
36+
- name: Delete DynamoDB Item
37+
uses: step-security/dynamodb-actions@v1
38+
env:
39+
AWS_DEFAULT_REGION: us-east-1
40+
AWS_REGION: us-east-1
41+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
42+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
43+
with:
44+
operation: delete
45+
region: us-east-1
46+
table: dynamodb-actions-test
47+
key: |
48+
{ key: "foo" }
49+
- name: Put DynamoDB Item (JSON input)
50+
uses: step-security/dynamodb-actions@v1
51+
env:
52+
AWS_DEFAULT_REGION: us-east-1
53+
AWS_REGION: us-east-1
54+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
55+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
56+
with:
57+
operation: put
58+
region: us-east-1
59+
table: dynamodb-actions-test
60+
item: |
61+
{
62+
key: "foo",
63+
commit: "${{ github.sha }}",
64+
value: "wow",
65+
awesome: true,
66+
stars: 12345
67+
}
68+
- name: Put DynamoDB Item (File Input)
69+
uses: step-security/dynamodb-actions@v1
70+
env:
71+
AWS_DEFAULT_REGION: us-east-1
72+
AWS_REGION: us-east-1
73+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
74+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
75+
with:
76+
operation: put
77+
region: us-east-1
78+
table: dynamodb-actions-test
79+
file: fixtures/item.json
80+
- name: BatchPut DynamoDB Item (JSON input)
81+
uses: step-security/dynamodb-actions@v1
82+
env:
83+
AWS_DEFAULT_REGION: us-east-1
84+
AWS_REGION: us-east-1
85+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
86+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
87+
with:
88+
operation: batch-put
89+
region: us-east-1
90+
table: dynamodb-actions-test
91+
items: |
92+
[{
93+
key: "foo",
94+
commit: "${{ github.sha }}",
95+
value: "wow",
96+
awesome: true,
97+
stars: 12345
98+
}, {
99+
key: "bar",
100+
value: "baz"
101+
}]
102+
- name: BatchPut DynamoDB Item (File Input)
103+
uses: step-security/dynamodb-actions@v1
104+
env:
105+
AWS_DEFAULT_REGION: us-east-1
106+
AWS_REGION: us-east-1
107+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
108+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
109+
with:
110+
operation: batch-put
111+
region: us-east-1
112+
table: dynamodb-actions-test
113+
files: fixtures/*.json

.github/workflows/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: workflow
2+
on: [push, pull_request]
3+
jobs:
4+
job:
5+
runs-on: ubuntu-latest
6+
container: node:20
7+
steps:
8+
- uses: actions/checkout@v1
9+
- name: Prepare
10+
run: npm ci
11+
- name: Build
12+
run: npm run build

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release new action version
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
TAG_NAME:
6+
description: 'Tag name that the major tag will point to'
7+
required: true
8+
9+
env:
10+
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
11+
defaults:
12+
run:
13+
shell: pwsh
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
update_tag:
20+
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
21+
# Remember to configure the releaseNewActionVersion environment with required approvers in the repository settings
22+
environment:
23+
name: releaseNewActionVersion
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
27+
steps:
28+
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423
29+
with:
30+
egress-policy: audit
31+
32+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
33+
34+
- name: Update the ${{ env.TAG_NAME }} tag
35+
uses: step-security/publish-action@b438f840875fdcb7d1de4fc3d1d30e86cf6acb5d
36+
with:
37+
source-tag: ${{ env.TAG_NAME }}

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:lts-alpine
2+
3+
RUN mkdir -p /var/task/
4+
5+
WORKDIR /var/task
6+
7+
COPY package.json package-lock.json /var/task/
8+
RUN npm ci --production
9+
10+
COPY entrypoint.sh dist /var/task/
11+
12+
ENTRYPOINT ["/var/task/entrypoint.sh"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

0 commit comments

Comments
 (0)