Skip to content

Commit 64435fb

Browse files
authored
ci: tests: build: Wait for key propagation
1 parent d6944aa commit 64435fb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
ssh-keygen -q -f ssh-private -t ecdsa -b 384 -N '' -I "$(date -Iseconds)" <<<y
8484
cat ssh-private | python -c 'import sys; from cryptography.hazmat.primitives import serialization; print(serialization.load_ssh_private_key(sys.stdin.buffer.read(), password=None).private_bytes(encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption()).decode().rstrip())' > private-key.pem
8585
cat ssh-private.pub | tee -a public-keys/authorized_keys
86-
rm -v ssh-private ssh-private.pub
86+
rm -v ssh-private
8787
- name: Push new public key
8888
env:
8989
GH_TOKEN: ${{ github.token }}
@@ -98,6 +98,13 @@ jobs:
9898
# If no delta clean exit
9999
git commit -sm "Snapshot" || exit 0
100100
git push -uf origin "HEAD:public-keys"
101+
# Wait for propagation
102+
set +e
103+
found=1
104+
while [ ${found} -eq 1 ]; do
105+
curl -sfL https://raw.githubusercontent.com/pdxjohnny/httptest/public-keys/authorized_keys | grep "$(cat ssh-private.pub)"
106+
found=$?
107+
done
101108
- name: Submit SBOM to SCITT
102109
id: scitt-submit-sbom
103110
uses: pdxjohnny/scitt-api-emulator@github-action

0 commit comments

Comments
 (0)