Skip to content

Commit 798f0de

Browse files
authored
Clean up gpg-sign and papertrail actions (#5)
* remove quotes * update papertrail * update papertrail * cleanup * require version * fix name
1 parent 08c9ab0 commit 798f0de

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ You can also supply multiple space-separated filenames to sign a list of files:
6464
- name: "Create detached signature"
6565
uses: mongodb/drivers-github-tools/garasign/gpg-sign@main
6666
with:
67-
filenames: somefile.ext someotherfile.txt
67+
filenames: dist/*
6868
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
6969
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
7070
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
@@ -87,6 +87,6 @@ By default it will create a "papertrail.txt" file in the current directory.
8787
with:
8888
product_name: Mongo Python Driver
8989
release_version: ${{ github.ref_name }}
90-
filenames: $DIST_FILES
90+
filenames: dist/*
9191
token: ${{ github.token }}
9292
```

garasign/gpg-sign/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Sign artifact using garasign"
22
description: "Signs a release artifact"
33
inputs:
44
filenames:
5-
description: "File names to sign, space separated"
5+
description: "File name(s) to sign, can be a glob pattern"
66
required: true
77
garasign_username:
88
description: "Garasign username"
@@ -54,5 +54,5 @@ runs:
5454
-v $(pwd):$(pwd) \
5555
-w $(pwd) \
5656
${{ inputs.artifactory_registry }}/${{ inputs.artifactory_image }} \
57-
/bin/bash -c 'gpgloader && for filename in "${{ inputs.filenames }}"; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
57+
/bin/bash -c 'gpgloader && for filename in ${{ inputs.filenames }}; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
5858
shell: bash

papertrail/action.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ inputs:
55
description: "Name of product"
66
required: true
77
release_version:
8-
description: "The release version. If not provided, the github.ref_name variable will be used"
9-
required: false
8+
description: "The release version"
9+
required: true
1010
filenames:
11-
description: "Artifact filenames to include in the report, space-separated"
11+
description: "Artifact filename(s) to include in the report, can be a glob pattern"
1212
required: true
1313
token:
1414
description: "The GitHub token for the action"
1515
required: true
1616
output:
1717
description: "The output filename"
18-
default: "papertail.txt"
18+
default: "papertrail.txt"
1919

2020
runs:
2121
using: composite
@@ -26,16 +26,12 @@ runs:
2626
export GH_TOKEN=${{ inputs.token }}
2727
NAME=$(gh api users/${{ github.actor }} --jq '.name')
2828
export PAPERTRAIL="${{ inputs.output }}"
29-
export VERSION="${{ github.ref_name }}"
30-
if [ -n "${{ inputs.release_version }}" ]; then
31-
export VERSION="${{ inputs.release_version }}"
32-
fi
3329
echo "Product: ${{ inputs.product_name }}" > $PAPERTRAIL
34-
echo "Version: $VERSION" >> $PAPERTRAIL
30+
echo "Version: ${{ inputs.release_version }}" >> $PAPERTRAIL
3531
echo "Releaser: $NAME" >> $PAPERTRAIL
3632
echo "Build Source: GitHub Actions"
3733
echo "Build Number: ${{ github.run_id }}"
38-
for filename in"${{ inputs.filenames }}"; do
34+
for filename in ${{ inputs.filenames }}; do
3935
SHA=$(shasum -a 256 $filename | awk '{print $1;}')
4036
echo "Filename: $filename" >> $PAPERTRAIL
4137
echo "Shasum: $SHA" >> $PAPERTRAIL

0 commit comments

Comments
 (0)