Skip to content

Commit 4c9371a

Browse files
committed
Ensure user permissions on build steps
1 parent 4123dd0 commit 4c9371a

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,20 @@ jobs:
4343
password: ${{ secrets.DOCKERHUB_PASSWORD }}
4444
- name: Set up Docker Buildx
4545
uses: docker/setup-buildx-action@v3
46-
- name: Install Deb build scripts
47-
run: sudo apt-get install devscripts build-essential lintian dput dh-make python3-paramiko
48-
- name: Import GPG key
49-
uses: crazy-max/ghaction-import-gpg@v6
50-
with:
51-
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
52-
- uses: webfactory/[email protected]
53-
with:
54-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
55-
56-
- name: Release snapshot
46+
- name: Setup build environment
5747
run: |
48+
sudo apt-get install devscripts build-essential lintian dput dh-make python3-paramiko
49+
echo -e "${{ secrets.GPG_SIGNING_KEY }}" | gpg --import
5850
# workaround for expired key until it gets updated
5951
gpg --quick-set-expire F0AB06E81EEBCED6F69460F12B13D750E4ECCA9D 2025-02-05
52+
mkdir -p ~/.ssh
53+
echo -e "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
54+
chmod 0600 ~/.ssh/id_rsa
6055
61-
mkdir -p /home/runner/.ssh
56+
- name: Release snapshot
57+
run: |
6258
source env.sh
63-
sudo -E go run mage.go -v ${{ matrix.platform }}
59+
go run mage.go -v ${{ matrix.platform }}
6460
6561
- name: Release Go report
6662
if: github.ref == 'refs/heads/master'
@@ -97,24 +93,20 @@ jobs:
9793
password: ${{ secrets.DOCKERHUB_PASSWORD }}
9894
- name: Set up Docker Buildx
9995
uses: docker/setup-buildx-action@v3
100-
- name: Install Deb build scripts
101-
run: sudo apt-get install devscripts build-essential lintian dput dh-make python3-paramiko
102-
- name: Import GPG key
103-
uses: crazy-max/ghaction-import-gpg@v6
104-
with:
105-
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
106-
- uses: webfactory/[email protected]
107-
with:
108-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
109-
110-
- name: Release tag
96+
- name: Setup build environment
11197
run: |
98+
sudo apt-get install devscripts build-essential lintian dput dh-make python3-paramiko
99+
echo -e "${{ secrets.GPG_SIGNING_KEY }}" | gpg --import
112100
# workaround for expired key until it gets updated
113101
gpg --quick-set-expire F0AB06E81EEBCED6F69460F12B13D750E4ECCA9D 2025-02-05
102+
mkdir -p ~/.ssh
103+
echo -e "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
104+
chmod 0600 ~/.ssh/id_rsa
114105
115-
mkdir -p /home/runner/.ssh
116-
source build/env.sh
117-
sudo -E go run mage.go -v ${{ matrix.platform }}
106+
- name: Release tag
107+
run: |
108+
source env.sh
109+
go run mage.go -v ${{ matrix.platform }}
118110
119111
post-release:
120112
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)