From 4634d797055465aff5e7990c4c12787bb4e12183 Mon Sep 17 00:00:00 2001 From: Connor O'Kane Date: Fri, 5 Jul 2024 15:44:27 +0100 Subject: [PATCH] adding config + pipeline --- .github/workflows/pipeline.yaml | 40 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index b66913d2b..26a2a8d67 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -12,7 +12,7 @@ permissions: id-token: write contents: read -jobs: +jobs: deploy-infra: runs-on: ubuntu-latest steps: @@ -33,29 +33,27 @@ jobs: run: | az account show + - name: Install jq + run: | + sudo apt-get install jq -y + + - name: List all Repositories and Branches from JSON file + run: | + echo "Checking Repositories and Branches" + cat ./components/test-repos.json + for repo in $(jq -r '.[]' ./components/test-repos.json); do + echo "Checking repository: $repo" + curl -H "Authorization: token ${{ secrets.PAT_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/hmcts/$repo - - name: Install jq - run: | - sudo apt-get install jq -y - - - name: Debug Repositories and Branches - run: | - echo "Checking Repositories and Branches" - cat ./components/test-repos.json - for repo in $(jq -r '.[]' ./components/test-repos.json); do - echo "Checking repository: $repo" - curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + for branch in main master; do + echo "Checking branch: $branch in repository: $repo" + curl -H "Authorization: token ${{ secrets.PAT_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/hmcts/$repo - - for branch in main master; do - echo "Checking branch: $branch in repository: $repo" - curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/hmcts/$repo/branches/$branch - done + https://api.github.com/repos/hmcts/$repo/branches/$branch done - + done - name: Terraform Init working-directory: components