[GHA] Fail early when required secret not set.

This commit is contained in:
s3rj1k 2024-06-22 18:49:55 +02:00
parent 70c5520466
commit 1c7163e2ce
No known key found for this signature in database
10 changed files with 16 additions and 19 deletions

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc -a armhf ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc -a armhf ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/rpi/debian-dev/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/rpi/debian-dev/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc -a arm64 ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc -a arm64 ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc -a armhf ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc -a armhf ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/rpi/debian-dev/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/rpi/debian-dev/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc -a arm64 ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc -a arm64 ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -64,7 +64,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -73,7 +73,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc -a armhf ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc -a armhf ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/rpi/debian-dev/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/rpi/debian-dev/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -63,7 +63,7 @@ RUN echo "export VERSION=$(cat ./build/next-release.txt | tr -d '\n')" | tee -a
RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x RUN . ~/.env && ./debian/util.sh prep-create-orig -n -V${VERSION}-${BUILD_NUMBER}-${GIT_SHA} -x
RUN . ~/.env && ./debian/util.sh prep-create-dsc -a arm64 ${CODENAME} RUN . ~/.env && ./debian/util.sh prep-create-dsc -a arm64 ${CODENAME}
RUN --mount=type=secret,id=REPO_PASSWORD \ RUN --mount=type=secret,id=REPO_PASSWORD,required=true \
printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \ printf "machine ${REPO_DOMAIN} " > /etc/apt/auth.conf && \
printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \ printf "login ${REPO_USERNAME} " >> /etc/apt/auth.conf && \
printf "password " >> /etc/apt/auth.conf && \ printf "password " >> /etc/apt/auth.conf && \
@ -72,7 +72,6 @@ RUN --mount=type=secret,id=REPO_PASSWORD \
--fail \ --fail \
--netrc-file /etc/apt/auth.conf \ --netrc-file /etc/apt/auth.conf \
--output ${GPG_KEY} \ --output ${GPG_KEY} \
--silent \
https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \ https://${REPO_DOMAIN}/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg && \
file ${GPG_KEY} && \ file ${GPG_KEY} && \
apt-get --quiet update && \ apt-get --quiet update && \

View File

@ -1,6 +1,12 @@
name: Build and Distribute name: Build and Distribute
on: on:
pull_request_target:
types:
- ready_for_review
paths:
- '**'
- '!.github/'
pull_request: pull_request:
push: push:
branches: branches:
@ -23,7 +29,7 @@ jobs:
run: | run: |
JSON="[]" JSON="[]"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "pull_request_target" ]]; then
JSON=$(jq -n '[ JSON=$(jq -n '[
{ {
"version": "bookworm", "version": "bookworm",