From 54219b813dbf6d3f07a7e1cd2a30f759bd996672 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 2 Oct 2023 14:21:32 -0400 Subject: [PATCH 1/2] github: ver contains an array This partly reverts 7b14aa0d4 where the `()` was misinterpreted as a subshell while it was in fact the notation for array parsing. Signed-off-by: Simon Deziel --- .github/workflows/builds.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 517d0c55b..802e53212 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -50,7 +50,8 @@ jobs: localRev="$(git rev-parse HEAD)" go install github.com/canonical/lxd-ci/lxd-snapcraft@latest git clone -b "${TARGET}" git+ssh://lxdbot@git.launchpad.net/~canonical-lxd/lxd ~/lxd-pkg-snap-lp - ver="$(lxd-snapcraft -get-version -file ~/lxd-pkg-snap-lp/snapcraft.yaml)" + # XXX: `ver` contains an array with the 2 versions + ver=($(lxd-snapcraft -get-version -file ~/lxd-pkg-snap-lp/snapcraft.yaml)) rsync -a --exclude .git --delete . ~/lxd-pkg-snap-lp/ cd ~/lxd-pkg-snap-lp lxd-snapcraft -set-version "${ver[0]}" -set-source-commit "${ver[1]}" From 358a59a892a7022eba82b4c268ebaee9379caac9 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 2 Oct 2023 14:23:32 -0400 Subject: [PATCH 2/2] github: set -eux on shell snippets Signed-off-by: Simon Deziel --- .github/workflows/builds.yml | 3 ++- .github/workflows/commits.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 802e53212..57b5c9f87 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -21,6 +21,7 @@ jobs: SSH_AUTH_SOCK: /tmp/ssh_agent.sock LAUNCHPAD_LXD_BOT_KEY: ${{ secrets.LAUNCHPAD_LXD_BOT_KEY }} run: | + set -eux mkdir -m 0700 -p ~/.ssh/ ssh-agent -a "${SSH_AUTH_SOCK}" > /dev/null ssh-add - <<< "${{ secrets.LAUNCHPAD_LXD_BOT_KEY }}" @@ -40,7 +41,7 @@ jobs: SSH_AUTH_SOCK: /tmp/ssh_agent.sock TARGET: ${{ github.ref_name }} run: | - set -x + set -eux git config --global transfer.fsckobjects true git config --global user.name "Canonical LXD Bot" git config --global user.email "lxd@lists.canonical.com" diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 2c6f78e7b..2f3948a53 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -33,7 +33,7 @@ jobs: env: TARGET: ${{ github.event.pull_request.base.ref }} run: | - set -x + set -eux [ "${TARGET}" = "latest-edge" ] && exit 0 echo "Invalid branch target: ${TARGET}"