From 33b74535b2e80723382c9a571813bde25698803b Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Mon, 26 Feb 2024 20:43:28 +0100 Subject: [PATCH] fix(ci): use sha rather than branch for "wait-on" action (#1150) --- .github/workflows/update-argocd-metadata.yml | 90 ++++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/update-argocd-metadata.yml b/.github/workflows/update-argocd-metadata.yml index e5413344f..d80fa38ec 100644 --- a/.github/workflows/update-argocd-metadata.yml +++ b/.github/workflows/update-argocd-metadata.yml @@ -3,7 +3,7 @@ name: Update argocd_metadata on: push: branches: - - main + - main jobs: update: @@ -14,47 +14,47 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Main Repository - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - name: Get SHA - length 7 - id: get_sha - run: | - echo "sha=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT - - - name: Wait for Backend Docker Image - uses: lewagon/wait-on-check-action@v1.3.3 - with: - ref: ${{ github.ref }} - check-name: Build Backend Docker Image - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Wait for Website Docker Image - uses: lewagon/wait-on-check-action@v1.3.3 - with: - ref: ${{ github.ref }} - check-name: Build Website Docker Image - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Checkout External Repository - uses: actions/checkout@v4 - with: - repository: 'loculus-project/argocd_metadata' - token: ${{ secrets.ARGOCD_METADATA_PAT }} - - - name: Modify config.json - run: | - echo '{ - "branch" : "main", - "number" : 999, - "head_short_sha_7": "${{ steps.get_sha.outputs.sha }}" - }' > config.json - - - name: Commit and Push Changes - run: | - git config --global user.name 'Loculus bot' - git config --global user.email 'bot@loculus.org' - git add config.json - git commit -m "Update config.json" - git push --force + - name: Checkout Main Repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - name: Get SHA - length 7 + id: get_sha + run: | + echo "sha=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT + + - name: Wait for Backend Docker Image + uses: lewagon/wait-on-check-action@v1.3.3 + with: + ref: ${{ github.sha }} + check-name: Build Backend Docker Image + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Wait for Website Docker Image + uses: lewagon/wait-on-check-action@v1.3.3 + with: + ref: ${{ github.sha }} + check-name: Build Website Docker Image + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout External Repository + uses: actions/checkout@v4 + with: + repository: "loculus-project/argocd_metadata" + token: ${{ secrets.ARGOCD_METADATA_PAT }} + + - name: Modify config.json + run: | + echo '{ + "branch" : "main", + "number" : 999, + "head_short_sha_7": "${{ steps.get_sha.outputs.sha }}" + }' > config.json + + - name: Commit and Push Changes + run: | + git config --global user.name 'Loculus bot' + git config --global user.email 'bot@loculus.org' + git add config.json + git commit -m "Update config.json" + git push --force