pantry/.github/actions/has-artifacts/action.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

2023-02-24 23:50:10 +03:00
name: tea/pantry/has-artifacts
2023-02-25 00:02:13 +03:00
description: Determines if PR artifacts exist for a given SHA
2023-02-24 23:50:10 +03:00
inputs:
2023-02-25 00:02:13 +03:00
repo:
description: The repo to check for artifacts
required: true
sha:
description: The SHA to check for artifacts
required: true
token:
description: The GitHub token to use
required: true
s3-bucket:
description: The S3 bucket to use
required: true
aws-access-key-id:
description: The AWS access key ID to use
required: true
aws-secret-access-key:
description: The AWS secret access key to use
2023-02-24 23:50:10 +03:00
required: true
outputs:
2023-02-25 00:02:13 +03:00
has-artifacts:
description: whether there is a PR associated with that SHA with artifacts in staging
value: ${{ steps.has-artifacts.outputs.has-artifacts }}
2023-02-24 23:50:10 +03:00
runs:
using: composite
steps:
- uses: teaxyz/setup@v0
with:
srcroot: null
- uses: teaxyz/pantry.core/.github/actions/cache@main
with:
cache-name: has-artifacts
2023-02-25 00:02:13 +03:00
- run: ${{github.action_path}}/has-artifacts.ts ${{ inputs.REPO }} ${{ inputs.SHA }} >>$GITHUB_OUTPUT
2023-02-24 23:50:10 +03:00
shell: sh
2023-02-25 00:02:13 +03:00
id: has-artifacts
2023-02-24 23:50:10 +03:00
env:
2023-02-25 00:02:13 +03:00
GITHUB_TOKEN: ${{ inputs.token }}
AWS_S3_CACHE: ${{ inputs.s3-bucket }}
AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }}