From e1260b2337b552a662825ca0df85ea00f25879e2 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 6 Dec 2021 10:12:25 -0700 Subject: [PATCH] ci: another stab at quoting for this GH key stuff Objectively awful, but avoids a python dep on yaml --- .github/workflows/gen_debian10.3.yml | 2 +- .github/workflows/gen_debian10.3_continuous.yml | 2 +- .github/workflows/gen_debian10.3_tag.yml | 2 +- .github/workflows/gen_debian11.yml | 2 +- .github/workflows/gen_debian11_continuous.yml | 2 +- .github/workflows/gen_debian11_tag.yml | 2 +- .github/workflows/gen_debian9.12.yml | 2 +- .github/workflows/gen_debian9.12_continuous.yml | 2 +- .github/workflows/gen_debian9.12_tag.yml | 2 +- ci/generate-workflows.py | 5 ++++- 10 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gen_debian10.3.yml b/.github/workflows/gen_debian10.3.yml index 3a9b6284f..b3f88db68 100644 --- a/.github/workflows/gen_debian10.3.yml +++ b/.github/workflows/gen_debian10.3.yml @@ -36,7 +36,7 @@ jobs: run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" - name: "Add GitHub package list" shell: bash - run: "echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null" + run: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null' - name: "Update APT" shell: bash run: "apt update" diff --git a/.github/workflows/gen_debian10.3_continuous.yml b/.github/workflows/gen_debian10.3_continuous.yml index abcaee9a6..004303798 100644 --- a/.github/workflows/gen_debian10.3_continuous.yml +++ b/.github/workflows/gen_debian10.3_continuous.yml @@ -50,7 +50,7 @@ jobs: shell: bash run: | export BUILD_REASON=Schedule - echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null - name: "Update APT" shell: bash run: | diff --git a/.github/workflows/gen_debian10.3_tag.yml b/.github/workflows/gen_debian10.3_tag.yml index 3e183d476..0c13a64ba 100644 --- a/.github/workflows/gen_debian10.3_tag.yml +++ b/.github/workflows/gen_debian10.3_tag.yml @@ -27,7 +27,7 @@ jobs: run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" - name: "Add GitHub package list" shell: bash - run: "echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null" + run: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null' - name: "Update APT" shell: bash run: "apt update" diff --git a/.github/workflows/gen_debian11.yml b/.github/workflows/gen_debian11.yml index 573b2636f..1ffa24bb2 100644 --- a/.github/workflows/gen_debian11.yml +++ b/.github/workflows/gen_debian11.yml @@ -36,7 +36,7 @@ jobs: run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" - name: "Add GitHub package list" shell: bash - run: "echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null" + run: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null' - name: "Update APT" shell: bash run: "apt update" diff --git a/.github/workflows/gen_debian11_continuous.yml b/.github/workflows/gen_debian11_continuous.yml index cd987ee76..6f278e7c2 100644 --- a/.github/workflows/gen_debian11_continuous.yml +++ b/.github/workflows/gen_debian11_continuous.yml @@ -50,7 +50,7 @@ jobs: shell: bash run: | export BUILD_REASON=Schedule - echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null - name: "Update APT" shell: bash run: | diff --git a/.github/workflows/gen_debian11_tag.yml b/.github/workflows/gen_debian11_tag.yml index a0ec214a1..407d08d8c 100644 --- a/.github/workflows/gen_debian11_tag.yml +++ b/.github/workflows/gen_debian11_tag.yml @@ -27,7 +27,7 @@ jobs: run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" - name: "Add GitHub package list" shell: bash - run: "echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null" + run: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null' - name: "Update APT" shell: bash run: "apt update" diff --git a/.github/workflows/gen_debian9.12.yml b/.github/workflows/gen_debian9.12.yml index c53ea519d..3881e2722 100644 --- a/.github/workflows/gen_debian9.12.yml +++ b/.github/workflows/gen_debian9.12.yml @@ -50,7 +50,7 @@ jobs: run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" - name: "Add GitHub package list" shell: bash - run: "echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null" + run: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null' - name: "Update APT" shell: bash run: "apt update" diff --git a/.github/workflows/gen_debian9.12_continuous.yml b/.github/workflows/gen_debian9.12_continuous.yml index e42723aa6..c2190afa7 100644 --- a/.github/workflows/gen_debian9.12_continuous.yml +++ b/.github/workflows/gen_debian9.12_continuous.yml @@ -63,7 +63,7 @@ jobs: shell: bash run: | export BUILD_REASON=Schedule - echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null - name: "Update APT" shell: bash run: | diff --git a/.github/workflows/gen_debian9.12_tag.yml b/.github/workflows/gen_debian9.12_tag.yml index 656e8c238..e306c679a 100644 --- a/.github/workflows/gen_debian9.12_tag.yml +++ b/.github/workflows/gen_debian9.12_tag.yml @@ -41,7 +41,7 @@ jobs: run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" - name: "Add GitHub package list" shell: bash - run: "echo deb \\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\] https://cli.github.com/packages stable main | tee /etc/apt/sources.list.d/github-cli.list > /dev/null" + run: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null' - name: "Update APT" shell: bash run: "apt update" diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index ac2aa3c86..280cafbc4 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -18,6 +18,9 @@ def yv(v, depth=0): for l in v.splitlines(): result = result + "\n" + (f"{indent}{l}" if l else "") return "|" + result + # This is hideous + if '"' in v: + return "'" + v + "'" return '"' + v + '"' return v @@ -536,7 +539,7 @@ cargo build --all --release""", ), RunStep( "Add GitHub package list", - f"echo deb \\\\[arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg\\\\] https://cli.github.com/packages stable main | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null", + f'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null', ), RunStep("Update APT", f"{sudo}apt update"), RunStep("Install GH CLI", f"{sudo} apt install gh"),