Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You can also supply multiple space-separated filenames to sign a list of files:
- name: "Create detached signature"
uses: mongodb/drivers-github-tools/garasign/gpg-sign@main
with:
filenames: somefile.ext someotherfile.txt
filenames: dist/*
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
Expand All @@ -87,6 +87,6 @@ By default it will create a "papertrail.txt" file in the current directory.
with:
product_name: Mongo Python Driver
release_version: ${{ github.ref_name }}
filenames: $DIST_FILES
filenames: dist/*
token: ${{ github.token }}
```
4 changes: 2 additions & 2 deletions garasign/gpg-sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Sign artifact using garasign"
description: "Signs a release artifact"
inputs:
filenames:
description: "File names to sign, space separated"
description: "File name(s) to sign, can be a glob pattern"
required: true
garasign_username:
description: "Garasign username"
Expand Down Expand Up @@ -54,5 +54,5 @@ runs:
-v $(pwd):$(pwd) \
-w $(pwd) \
${{ inputs.artifactory_registry }}/${{ inputs.artifactory_image }} \
/bin/bash -c 'gpgloader && for filename in "${{ inputs.filenames }}"; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
/bin/bash -c 'gpgloader && for filename in ${{ inputs.filenames }}; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was under the assumption that the space separated lists needed to be quoted. This is much better!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have. We only support single filenames or a glob pattern now. But it was surprisingly difficult to generate a space separated list from a directory listing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. Works for me 👍

shell: bash
16 changes: 6 additions & 10 deletions papertrail/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ inputs:
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
description: "The release version"
required: true
filenames:
description: "Artifact filenames to include in the report, space-separated"
description: "Artifact filename(s) to include in the report, can be a glob pattern"
required: true
token:
description: "The GitHub token for the action"
required: true
output:
description: "The output filename"
default: "papertail.txt"
default: "papertrail.txt"

runs:
using: composite
Expand All @@ -26,16 +26,12 @@ runs:
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 "Version: ${{ inputs.release_version }}" >> $PAPERTRAIL
echo "Releaser: $NAME" >> $PAPERTRAIL
echo "Build Source: GitHub Actions"
echo "Build Number: ${{ github.run_id }}"
for filename in"${{ inputs.filenames }}"; do
for filename in ${{ inputs.filenames }}; do
SHA=$(shasum -a 256 $filename | awk '{print $1;}')
echo "Filename: $filename" >> $PAPERTRAIL
echo "Shasum: $SHA" >> $PAPERTRAIL
Expand Down