@@ -9,27 +9,35 @@ inputs:
99 required : true
1010 filenames :
1111 description : Artifact filename(s) to include in the report, can be a glob pattern
12- required : true
12+ default : " "
1313 token :
1414 description : The GitHub token for the action
15- required : true
1615
1716runs :
1817 using : composite
1918 steps :
2019 - name : Prepare report
2120 shell : bash
2221 run : |
23- export GH_TOKEN=${{ inputs.token }}
22+ if [ -n "${{ inputs.token }}" ]; then
23+ export GH_TOKEN=${{ inputs.token }}
24+ fi
2425 NAME=$(gh api users/${{ github.actor }} --jq '.name')
2526 export REPORT=$S3_ASSETS/authorized-publication.txt
26- echo "Product: ${{ inputs.product_name }}" > $REPORT
27- echo "Version: ${{ inputs.release_version }}" >> $REPORT
28- echo "Releaser: $NAME" >> $REPORT
29- echo "Build Source: GitHub Actions"
30- echo "Build Number: ${{ github.run_id }}"
31- for filename in ${{ inputs.filenames }}; do
32- SHA=$(shasum -a 256 $filename | awk '{print $1;}')
33- echo "Filename: $filename" >> $REPORT
34- echo "Shasum: $SHA" >> $REPORT
35- done
27+ export FILENAMES=${{ inputs.filenames }}
28+ cat << EOF > $REPORT
29+ Product: ${{ inputs.product_name }}
30+ Version: ${{ inputs.release_version }}
31+ Releaser: $NAME
32+ Build Source: GitHub Actions
33+ Build Number: ${{ github.run_id }}
34+ EOF
35+ if [ -z "$FILENAMES" ]; then
36+ echo "No published artifacts." >> $REPORT
37+ else
38+ for filename in ${{ inputs.filenames }}; do
39+ SHA=$(shasum -a 256 $filename | awk '{print $1;}')
40+ echo "Filename: $filename" >> $REPORT
41+ echo "Shasum: $SHA" >> $REPORT
42+ done
43+ fi
0 commit comments