-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add papertrail action * fix loop * Update papertrail/action.yml Co-authored-by: Andreas Braun <[email protected]> --------- Co-authored-by: Andreas Braun <[email protected]>
- Loading branch information
Showing
2 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "Papertrail Report" | ||
description: "Generate report for authorized publication on distribution channels" | ||
inputs: | ||
product_name: | ||
description: "Name of product" | ||
required: true | ||
release_version: | ||
description: "The release version. If not provided, the github.ref_name variable will be used" | ||
required: false | ||
filenames: | ||
description: "Artifact filenames to include in the report, space-separated" | ||
required: true | ||
token: | ||
description: "The GitHub token for the action" | ||
required: true | ||
output: | ||
description: "The output filename" | ||
default: "papertail.txt" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Prepare report" | ||
shell: bash | ||
run: | | ||
export GH_TOKEN=${{ inputs.token }} | ||
NAME=$(gh api users/${{ github.actor }} --jq '.name') | ||
export PAPERTRAIL="${{ inputs.output }}" | ||
export VERSION="${{ github.ref_name }}" | ||
if [ -n "${{ inputs.release_version }}" ]; then | ||
export VERSION="${{ inputs.release_version }}" | ||
fi | ||
echo "Product: ${{ inputs.product_name }}" > $PAPERTRAIL | ||
echo "Version: $VERSION" >> $PAPERTRAIL | ||
echo "Releaser: $NAME" >> $PAPERTRAIL | ||
echo "Build Source: GitHub Actions" | ||
echo "Build Number: ${{ github.run_id }}" | ||
for filename in"${{ inputs.filenames }}"; do | ||
SHA=$(shasum -a 256 $filename | awk '{print $1;}') | ||
echo "Filename: $filename" >> $PAPERTRAIL | ||
echo "Shasum: $SHA" >> $PAPERTRAIL | ||
done |