Merge pull request #475 from step-security/npm-audit-fix #46
This file contains hidden or 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@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 |