-
Notifications
You must be signed in to change notification settings - Fork 8
Add papertrail action #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not from within an action, "Note: This context property is set by the Actions runner, and is only available within the execution steps of a job." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. No problem then 👍 |
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ Thanks!