diff --git a/.github/workflows/dependabot-prs-manager.yaml b/.github/workflows/dependabot-prs-manager.yaml index 400a4842eb..35748a8e89 100644 --- a/.github/workflows/dependabot-prs-manager.yaml +++ b/.github/workflows/dependabot-prs-manager.yaml @@ -14,9 +14,6 @@ jobs: outputs: prs: ${{ steps.dependabot-prs.outputs.prs }} steps: - - name: Checkout - uses: actions/checkout@v4 - - name: List Dependabot PRs id: dependabot-prs run: | @@ -57,8 +54,7 @@ jobs: gh pr edit ${{ matrix.pr.number }} --add-label "type::security" echo "Re-running tests..." - branch=$(gh pr view ${{ matrix.pr.number }} --json headRefName -q '.headRefName') - run_id=$(gh run list --branch $branch --workflow build-test --limit 1 --json databaseId -q '.[0].databaseId') + run_id=$(gh run list --branch ${{ matrix.pr.headRefName }} --workflow build-test --limit 1 --json databaseId -q '.[0].databaseId') # If more than half of the validate-* jobs are successful, just re-run the failed jobs. num_of_jobs=$(gh run view $run_id --json jobs -q '.jobs[] | select(.name | startswith("validate-")) | .name' | wc -l) @@ -70,8 +66,10 @@ jobs: fi # Otherwise, re-run all workflows. - echo "Less than half of the validate-* jobs are successful. Re-running all workflows." + repo="https://${{ github.actor }}:${{ secrets.NIGHTLY_GH_PAT }}@github.com/${{ github.repository }}.git" + git config --global user.email ${{ github.actor }}@users.noreply.github.com git config --global user.name ${{ github.actor }} + git commit --allow-empty -m "[dependabot skip] Re-run workflows. [Triggered by the [dependabot-prs-manager](https://github.com/replicatedhq/kots/blob/main/.github/workflows/dependabot-prs-manager.yaml) GitHub action]" - git push origin $branch + git push $repo HEAD:"${{ matrix.pr.headRefName }}"