From 74cfe32385cfccebe05c9783ca7717f99b746511 Mon Sep 17 00:00:00 2001 From: csl-bot Date: Wed, 16 Oct 2024 12:04:27 +0000 Subject: [PATCH] copied .github/workflows/sheldon.yaml from styles --- .github/workflows/sheldon.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sheldon.yaml b/.github/workflows/sheldon.yaml index 0a1f859..c0af278 100644 --- a/.github/workflows/sheldon.yaml +++ b/.github/workflows/sheldon.yaml @@ -70,6 +70,13 @@ jobs: bundle config path vendor/bundle bundle update sheldon --jobs 4 --retry 3 + - name: Check if the user is a contributor + run: | + contributors=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/contributors" | jq -r '.[].login') + if echo "$contributors" | grep -q "${{ github.event.sender.login }}"; then + echo "contributor=--contributor" >> $GITHUB_ENV + fi + - name: Welcome to a new PR if: github.event.action == 'opened' && steps.changed.outputs.style == 'true' run: bundle exec sheldon --token=$GITHUB_TOKEN --welcome @@ -79,7 +86,7 @@ jobs: - name: report if: (failure() || success()) && steps.changed.outputs.style == 'true' - run: bundle exec sheldon --token=$GITHUB_TOKEN --${{ job.status }} --verbose + run: bundle exec sheldon --token=$GITHUB_TOKEN --${{ job.status }} --verbose ${{ env.contributor }} - name: commit reindented styles if: github.repository == 'citation-style-language/styles' && steps.changed.outputs.style == 'true'