]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
gh actions - replace yq snap in collect job build-and-test-all 14092/head
authorromeroalx <alexis.romero@open-xchange.com>
Fri, 5 Apr 2024 10:02:55 +0000 (12:02 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 6 May 2024 11:00:46 +0000 (13:00 +0200)
(cherry picked from commit 3a5fb2cb7e890e1ebb0e0e75f6349640fc76f878)

.github/workflows/build-and-test-all.yml

index ae67202cccd3ccaa3f835bbc7f92284d279142fc..edaf3b61c6a57afd71717975ebf521daac63807a 100644 (file)
@@ -215,19 +215,19 @@ jobs:
     if: success() || failure()
     runs-on: ubuntu-22.04
     steps:
-      - name: Install jq and yq
-        run: "sudo snap install jq yq"
+      - name: Install jq and jc
+        run: "sudo apt-get update && sudo apt-get install jq jc"
       - name: Fail job if any of the previous jobs failed
-        run: "for i in `echo '${{ toJSON(needs) }}' | jq '.[].result' | tr -d '\"'`; do if [[ $i == 'failure' ]]; then echo '${{ toJSON(needs) }}'; exit 1; fi; done;"
-      - uses: actions/checkout@v3
+        run: "for i in `echo '${{ toJSON(needs) }}' | jq -r '.[].result'`; do if [[ $i == 'failure' ]]; then echo '${{ toJSON(needs) }}'; exit 1; fi; done;"
+      - uses: actions/checkout@v4
         with:
           fetch-depth: 5
           submodules: recursive
           ref: ${{ inputs.branch-name }}
       - name: Get list of jobs in the workflow
-        run: "yq e '.jobs | keys' .github/workflows/build-and-test-all.yml | awk '{print $2}' | grep -v collect | sort | tee /tmp/workflow-jobs-list.yml"
+        run: "cat .github/workflows/build-and-test-all.yml | jc --yaml | jq -rS '.[].jobs | keys | .[]' | grep -v collect | tee /tmp/workflow-jobs-list.yml"
       - name: Get list of prerequisite jobs
-        run: "echo '${{ toJSON(needs) }}' | jq 'keys | .[]' | tr -d '\"' | sort | tee /tmp/workflow-needs-list.yml"
+        run: "echo '${{ toJSON(needs) }}' | jq -rS 'keys | .[]' | tee /tmp/workflow-needs-list.yml"
       - name: Fail if there is a job missing on the needs list
         run: "if ! diff -q /tmp/workflow-jobs-list.yml /tmp/workflow-needs-list.yml; then exit 1; fi"