diff --git a/.github/workflows/helm-chart-release.yaml b/.github/workflows/helm-chart-release.yaml index 2ebe8225..71a62742 100644 --- a/.github/workflows/helm-chart-release.yaml +++ b/.github/workflows/helm-chart-release.yaml @@ -9,12 +9,15 @@ jobs: contents: write runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Wait for container images build run: | while :; do - result=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/actions/runs | \ - jq -r '.workflow_runs | map(select(.name == "Release container images")) | sort_by(.created_at) | reverse | .[0]') + result=$(gh api repos/:owner/:repo/actions/workflows | jq -r '.workflows[] | select(.name=="Release container images") | .id' | xargs -I {} gh api repos/:owner/:repo/actions/workflows/{}/runs --jq '.workflow_runs | max_by(.run_number)') status=$(echo "$result" | jq -r '.status') conclusion=$(echo "$result" | jq -r '.conclusion') if [[ "$status" == "completed" ]]; then @@ -36,19 +39,12 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Helm - if: true uses: azure/setup-helm@v4 with: token: ${{ github.token }} - name: Add dependencies - if: true run: | helm repo add bitnami https://charts.bitnami.com/bitnami