-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
37 lines (33 loc) · 1.24 KB
/
action.yaml
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
name: 'store-artifacts'
description: 'Store workspace artifacts'
inputs:
artifact_name_override:
description: Override name of artifact to use
required: false
runs:
using: composite
steps:
- name: Check GitHub env set
id: check-github-env
if: ${{ ! env.GITHUB_REPOSITORY_OWNER_PART_SLUG_URL }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Please make sure to set the GitHub Action environment variable `GITHUB_REPOSITORY_OWNER_PART_SLUG_URL` set by using the `ServerlessOpsIO/gha-setup-workspace` or `rlespinasse/github-slug-action@v4` action')
- name: Set artifact name
id: set-artifact-name
shell: bash
env:
ARTIFACT_NAME: ${{ inputs.artifact_name_override }}
run: |
if [ -z "${ARTIFACT_NAME}" ]; then
name="${{ env.GITHUB_REPOSITORY_SLUG }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.run_number }}-${{ github.sha }}";
else
name="${{ inputs.artifact_name_override }}";
fi;
echo "Artifact name resolved to: $name"
echo "artifact-name=$name" >> $GITHUB_OUTPUT
outputs:
artifact-name:
description: Name of artifact stored
value: ${{ steps.set-artifact-name.outputs.artifact-name }}