diff --git a/.github/workflows/auto-update-contributors.yml b/.github/workflows/auto-update-contributors.yml index 914a7f26..95ba1021 100644 --- a/.github/workflows/auto-update-contributors.yml +++ b/.github/workflows/auto-update-contributors.yml @@ -25,14 +25,20 @@ jobs: run: | pr_title="docs(contributor): contributors readme action update" existing_pr=$(gh pr list --state open --search "$pr_title" --json title --jq '.[].title') - if [[ "$existing_pr" == "$pr_title" ]]; then + echo "::debug::List of open pull requests: $(gh pr list --state open --json title --jq '.[].title')" + if [[ -n "$existing_pr" ]]; then echo "Contributors pull request already exists. Exiting." + echo "::warning::bypassed per open pull request already exists" + echo "OpenContributorRequestAlreadyExists=true" >> $GITHUB_ENV exit 0 + else + echo "OpenContributorRequestAlreadyExists=false" >> $GITHUB_ENV fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Contribute List + if: env.OpenContributorRequestAlreadyExists == 'false' uses: akhilmhdh/contributors-readme-action@1ff4c56187458b34cd602aee93e897344ce34bfc # v2.3.10 with: pr_title_on_protected: 'docs(contributor): contributors readme action update'