Merge pull request #132 from step-security/dependabot/npm_and_yarn/fo… #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: example | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
job: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@v4 | |
- name: Get DynamoDB Item | |
id: config | |
uses: step-security/dynamodb-actions@v1 | |
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@v1 | |
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@v1 | |
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@v1 | |
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@v1 | |
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@v1 | |
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 |