Skip to content

Commit d9939b7

Browse files
committed
github actions: configure DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB
1 parent aa41af2 commit d9939b7

File tree

3 files changed

+120
-1
lines changed

3 files changed

+120
-1
lines changed

.github/workflows/release-master.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ jobs:
1313
runs-on: ubuntu-22.04
1414
container: golang:1.22
1515
steps:
16+
- name: Configure jetstack/venafi-connection-lib repo pull access
17+
run: |
18+
mkdir ~/.ssh
19+
chmod 700 ~/.ssh
20+
21+
echo "${{ secrets.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
22+
chmod 600 ~/.ssh/venafi_connection_lib_id
23+
24+
cat <<EOT >> ~/.ssh/config
25+
Host venafi-connection-lib.github.com
26+
HostName github.com
27+
IdentityFile ~/.ssh/venafi_connection_lib_id
28+
IdentitiesOnly yes
29+
EOT
30+
31+
cat <<EOT >> ~/.gitconfig
32+
[url "[email protected]:jetstack/venafi-connection-lib"]
33+
insteadOf = https://github.com/jetstack/venafi-connection-lib
34+
EOT
1635
- uses: actions/checkout@v4
1736
- run: make vet
1837
shell: bash
@@ -21,6 +40,25 @@ jobs:
2140
runs-on: ubuntu-22.04
2241
container: golang:1.22
2342
steps:
43+
- name: Configure jetstack/venafi-connection-lib repo pull access
44+
run: |
45+
mkdir ~/.ssh
46+
chmod 700 ~/.ssh
47+
48+
echo "${{ secrets.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
49+
chmod 600 ~/.ssh/venafi_connection_lib_id
50+
51+
cat <<EOT >> ~/.ssh/config
52+
Host venafi-connection-lib.github.com
53+
HostName github.com
54+
IdentityFile ~/.ssh/venafi_connection_lib_id
55+
IdentitiesOnly yes
56+
EOT
57+
58+
cat <<EOT >> ~/.gitconfig
59+
[url "[email protected]:jetstack/venafi-connection-lib"]
60+
insteadOf = https://github.com/jetstack/venafi-connection-lib
61+
EOT
2462
- uses: actions/checkout@v4
2563
- run: make test
2664
docker_build:
@@ -41,6 +79,25 @@ jobs:
4179
packages: write
4280
id-token: write
4381
steps:
82+
- name: Configure jetstack/venafi-connection-lib repo pull access
83+
run: |
84+
mkdir ~/.ssh
85+
chmod 700 ~/.ssh
86+
87+
echo "${{ secrets.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
88+
chmod 600 ~/.ssh/venafi_connection_lib_id
89+
90+
cat <<EOT >> ~/.ssh/config
91+
Host venafi-connection-lib.github.com
92+
HostName github.com
93+
IdentityFile ~/.ssh/venafi_connection_lib_id
94+
IdentitiesOnly yes
95+
EOT
96+
97+
cat <<EOT >> ~/.gitconfig
98+
[url "[email protected]:jetstack/venafi-connection-lib"]
99+
insteadOf = https://github.com/jetstack/venafi-connection-lib
100+
EOT
44101
- name: Install Tools
45102
# Installing 'bash' because it's required by the 'cosign-installer' action
46103
# and 'coreutils' because the 'slsa-provenance-action' requires a version

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,34 @@ on:
99
branches:
1010
- "*"
1111

12+
env:
13+
GOPRIVATE: github.com/jetstack/venafi-connection-lib
14+
1215
jobs:
1316
vet:
1417
name: vet
1518
runs-on: ubuntu-22.04
1619
container: golang:1.22
1720
steps:
21+
- name: Configure jetstack/venafi-connection-lib repo pull access
22+
run: |
23+
mkdir ~/.ssh
24+
chmod 700 ~/.ssh
25+
26+
echo "${{ secrets.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
27+
chmod 600 ~/.ssh/venafi_connection_lib_id
28+
29+
cat <<EOT >> ~/.ssh/config
30+
Host venafi-connection-lib.github.com
31+
HostName github.com
32+
IdentityFile ~/.ssh/venafi_connection_lib_id
33+
IdentitiesOnly yes
34+
EOT
35+
36+
cat <<EOT >> ~/.gitconfig
37+
[url "[email protected]:jetstack/venafi-connection-lib"]
38+
insteadOf = https://github.com/jetstack/venafi-connection-lib
39+
EOT
1840
- uses: actions/checkout@v4
1941
- run: make vet
2042
shell: bash
@@ -23,6 +45,25 @@ jobs:
2345
runs-on: ubuntu-22.04
2446
container: golang:1.22
2547
steps:
48+
- name: Configure jetstack/venafi-connection-lib repo pull access
49+
run: |
50+
mkdir ~/.ssh
51+
chmod 700 ~/.ssh
52+
53+
echo "${{ secrets.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
54+
chmod 600 ~/.ssh/venafi_connection_lib_id
55+
56+
cat <<EOT >> ~/.ssh/config
57+
Host venafi-connection-lib.github.com
58+
HostName github.com
59+
IdentityFile ~/.ssh/venafi_connection_lib_id
60+
IdentitiesOnly yes
61+
EOT
62+
63+
cat <<EOT >> ~/.gitconfig
64+
[url "[email protected]:jetstack/venafi-connection-lib"]
65+
insteadOf = https://github.com/jetstack/venafi-connection-lib
66+
EOT
2667
- uses: actions/checkout@v4
2768
- run: make test
2869
docker_build:
@@ -39,6 +80,25 @@ jobs:
3980
DOCKER_DRIVER: overlay
4081
DOCKER_HOST: tcp://localhost:2375
4182
steps:
83+
- name: Configure jetstack/venafi-connection-lib repo pull access
84+
run: |
85+
mkdir ~/.ssh
86+
chmod 700 ~/.ssh
87+
88+
echo "${{ secrets.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
89+
chmod 600 ~/.ssh/venafi_connection_lib_id
90+
91+
cat <<EOT >> ~/.ssh/config
92+
Host venafi-connection-lib.github.com
93+
HostName github.com
94+
IdentityFile ~/.ssh/venafi_connection_lib_id
95+
IdentitiesOnly yes
96+
EOT
97+
98+
cat <<EOT >> ~/.gitconfig
99+
[url "[email protected]:jetstack/venafi-connection-lib"]
100+
insteadOf = https://github.com/jetstack/venafi-connection-lib
101+
EOT
42102
- name: Install Tools
43103
run: apk add --update make git jq rsync curl
44104
- name: Adding github workspace as safe directory

builder.dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ WORKDIR /go/github.com/jetstack/preflight
77
COPY ./go.mod .
88
COPY ./go.sum .
99

10+
# Due to https://github.com/jetstack/venafi-connection-lib being private.
11+
COPY ~/.ssh/ ~/.gitconfig /root/
12+
1013
RUN go mod download
1114

1215
## Bring in everything else
@@ -22,7 +25,6 @@ RUN make build-all-platforms \
2225
OAUTH_CLIENT_SECRET=${oauth_client_secret} \
2326
OAUTH_AUTH_SERVER_DOMAIN=${oauth_auth_server_domain}
2427

25-
2628
RUN go install github.com/google/[email protected]
2729

2830
# We need this '|| true' because go-licenses could fail to find a license so

0 commit comments

Comments
 (0)