Skip to content

Commit 1dc1ac8

Browse files
authored
Merge pull request #3 from alcaeus/fix-actions
Fix actions
2 parents a4e8a0a + a8871d2 commit 1dc1ac8

File tree

4 files changed

+39
-70
lines changed

4 files changed

+39
-70
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,3 @@ You can also supply multiple space-separated filenames to sign a list of files:
6969
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
7070
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
7171
```
72-
73-
### setup
74-
75-
The setup action is used by `git-sign` and `gpg-sign` to create an env file and
76-
sign in to artifactory. It can also be used standalone.

garasign/git-sign/action.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "Sign artifact using garasign"
2-
description: "Signs a release artifact"
1+
name: "Run git actions in a signing container"
2+
description: "Allows running arbitrary git actions in a container with GPG keys loaded"
33
inputs:
44
command:
55
description: "Command to run inside the container"
@@ -29,15 +29,22 @@ inputs:
2929
runs:
3030
using: composite
3131
steps:
32-
- name: Prepare garasign container
32+
- name: Create the envfile
3333
if: ${{ inputs.skip_setup == 'false' }}
34-
uses: ./.github/actions/garasign/setup
34+
run: |
35+
cat << EOF > envfile
36+
GRS_CONFIG_USER1_USERNAME=${{ inputs.garasign_username }}
37+
GRS_CONFIG_USER1_PASSWORD=${{ inputs.garasign_password }}
38+
EOF
39+
shell: bash
40+
41+
- name: Log in to artifactory
42+
if: ${{ inputs.skip_setup == 'false' }}
43+
uses: redhat-actions/podman-login@v1
3544
with:
36-
garasign_username: ${{ inputs.garasign_username }}
37-
garasign_password: ${{ inputs.garasign_password }}
38-
artifactory_username: ${{ inputs.artifactory_username }}
39-
artifactory_password: ${{ inputs.artifactory_password }}
40-
artifactory_registry: ${{ inputs.artifactory_registry }}
45+
username: ${{ inputs.artifactory_username }}
46+
password: ${{ inputs.artifactory_password }}
47+
registry: ${{ inputs.artifactory_registry }}
4148

4249
- name: "Run git command"
4350
run: |

garasign/gpg-sign/action.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,30 @@ inputs:
2929
runs:
3030
using: composite
3131
steps:
32-
- name: Prepare garasign container
32+
- name: Create the envfile
3333
if: ${{ inputs.skip_setup == 'false' }}
34-
uses: ./.github/actions/garasign/setup
34+
run: |
35+
cat << EOF > envfile
36+
GRS_CONFIG_USER1_USERNAME=${{ inputs.garasign_username }}
37+
GRS_CONFIG_USER1_PASSWORD=${{ inputs.garasign_password }}
38+
EOF
39+
shell: bash
40+
41+
- name: Log in to artifactory
42+
if: ${{ inputs.skip_setup == 'false' }}
43+
uses: redhat-actions/podman-login@v1
3544
with:
36-
garasign_username: ${{ inputs.garasign_username }}
37-
garasign_password: ${{ inputs.garasign_password }}
38-
artifactory_username: ${{ inputs.artifactory_username }}
39-
artifactory_password: ${{ inputs.artifactory_password }}
40-
artifactory_registry: ${{ inputs.artifactory_registry }}
45+
username: ${{ inputs.artifactory_username }}
46+
password: ${{ inputs.artifactory_password }}
47+
registry: ${{ inputs.artifactory_registry }}
4148

42-
- name: "Create detached signature for filename"
49+
- name: "Create detached signature for file"
4350
run: |
44-
export filenames="${{ inputs.filenames }}"
45-
for filename in "${filenames[@]}"
46-
do
47-
podman run \
48-
--env-file=envfile \
49-
--rm \
50-
-v $(pwd):$(pwd) \
51-
-w $(pwd) \
52-
${{ inputs.artifactory_registry }}/${{ inputs.artifactory_image }} \
53-
/bin/bash -c "gpgloader && gpg --detach-sign --armor --output ${{ inputs.filename }}.sig ${{ inputs.filename }}"
54-
done
55-
shell: bash
51+
podman run \
52+
--env-file=envfile \
53+
--rm \
54+
-v $(pwd):$(pwd) \
55+
-w $(pwd) \
56+
${{ 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'
58+
shell: bash

garasign/setup/action.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)