diff --git a/.github/workflows/pr-sort.yml b/.github/workflows/pr-sort.yml index f13b495d13..b90160c933 100644 --- a/.github/workflows/pr-sort.yml +++ b/.github/workflows/pr-sort.yml @@ -84,10 +84,12 @@ jobs: # This check avoids a bug in all-contributors-cli (issue #371) where # adding an existing contribution type replaces all existing contributions if [[ -n "${{ steps.vars.outputs.contributor }}" ]]; then - pixi run install - pixi run add ${{ steps.vars.outputs.contributor }} conference CONTRIBUTOR="${{ steps.vars.outputs.contributor }}" - # Check if contributor already has "conference" contribution (the overlap triggers the bug) + # Check if contributor already has "conference" contribution (the overlap triggers the bug). + # IMPORTANT: there must be NO unconditional `all-contributors add` before this guard. + # all-contributors-cli replaces a contributor's whole contributions array when re-adding an + # existing type, so re-adding "conference" to someone who already has it strips their other + # contributions. The guard below is the ONLY add path: skip when "conference" is already present. if ! jq -e --arg login "$CONTRIBUTOR" '.contributors[] | select(.login == $login) | .contributions | index("conference")' .all-contributorsrc > /dev/null 2>&1; then echo "Adding conference contribution for: $CONTRIBUTOR" pixi run install