ghaction-import-gpg icon indicating copy to clipboard operation
ghaction-import-gpg copied to clipboard

Make it work with jobs.$.container

Open wscourge opened this issue 3 weeks ago • 0 comments

Description

When I do the following:

jobs:
  manage-package-on-yum:
    runs-on: ubuntu-latest
    container: centos:latest # important part
    steps:
    - uses: actions/checkout@v4
    - name: install dependencies
      run: |
        cd /etc/yum.repos.d/
        sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
        sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
        yum update -y
        yum install createrepo git gpg rpm rpm-sign -y
    - name: import gpg key
      uses: crazy-max/ghaction-import-gpg@v6
      with:
        gpg_private_key: ${{ secrets.LINUX_GPG2_PRIVATE_SIGN_KEY }}
        passphrase: ${{ secrets.LINUX_GPG2_APPIMAGETOOL_SIGN_PASSPHRASE }}
    - name: publish yum package
      run: |
        echo "%_gpg_name Firstname Lastname <[email protected]>" > ~/.rpmmacros
        createrepo .
        # createrepo --update .
        gpg --detach-sign --armor repodata/repomd.xml
        rpm --addsign "myappname-${APP_VERSION}-1.x86_64.rpm"
        # git add . && git commit -m "UPD to $APP_VERSION" && git push

I get the following trace with exit code 1:

warning: Could not set GPG_TTY to stdin: Inappropriate ioctl for device
gpg: skipped "Firstname Lastname <[email protected]>": No secret key
gpg: signing failed: No secret key
error: gpg exec failed (2)
myappname-0.0.0-1.x86_64.rpm:
Error: Process completed with exit code 1.

Everything (GH secrets) is in place - it works on ubuntu-latest when I publish the apt package to my PPA w/o container option.

wscourge avatar Jun 11 '24 07:06 wscourge