Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/ghprcomment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,16 @@
See [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md#pull-request-process) for more details.


# PR text
# PR hygiene

- jobName: 'Ensure that contributor is assigned (fails if not commented on issue)'
workflowName: 'On PR opened/updated'
message: >
You did not assign yourself to the issue.
Thus, it looks like you skipped reading our [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md), which explains exactly how to participate. No worries, it happens to the best of us.


Give it a read, and you’ll discover the ancient wisdom of assigning issues to yourself. Trust me, it’s worth it. 🚀

- jobName: 'PR title must not start with "Fix for issue <number>"'
workflowName: 'PR Tests'
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/on-pr-opened-updated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
skip-if-not-in-project: true
ensure_assignment:
name: Ensure that contributor is assigned (fails if not commented on issue)
if: github.event.pull_request.head.repo.full_name != 'JabRef/jabref'
# after determine_issue_number to ensure that there is only one failure because of no ticket number
needs: determine_issue_number
runs-on: ubuntu-latest
Expand Down Expand Up @@ -114,10 +115,22 @@ jobs:
# Append the new assignee
UPDATED_ASSIGNEES=$(echo "$ASSIGNEES" | jq --arg new "${{ github.event.pull_request.user.login }}" '. + [$new]')

LABELS=$(gh api repos/${{ github.repository }}/issues/${{ needs.determine_issue_number.outputs.issue_number }}/labels --jq '.[].name')
if echo "$LABELS" | grep -q "^good"; then
echo "✅ label good found"
SILENT=false
else
echo "🚫 Silent fail if not possible to add assignee"
SILENT=true
fi

# Update issue with the new assignee list
echo "Updating issue #${{ needs.determine_issue_number.outputs.issue_number }} updated with assignees: $UPDATED_ASSIGNEES..."
gh api -X PATCH /repos/JabRef/jabref/issues/${{ needs.determine_issue_number.outputs.issue_number }} --input <(echo "{\"assignees\": $UPDATED_ASSIGNEES}")

if [ "$SILENT" = true ]; then
gh api -X PATCH /repos/JabRef/jabref/issues/${{ needs.determine_issue_number.outputs.issue_number }} --input <(echo "{\"assignees\": $UPDATED_ASSIGNEES}") || true
else
gh api -X PATCH /repos/JabRef/jabref/issues/${{ needs.determine_issue_number.outputs.issue_number }} --input <(echo "{\"assignees\": $UPDATED_ASSIGNEES}")
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add label "📌 Pinned"
Expand Down