Skip to content

Regression: size labeler PUTs the full label set and deletes labels added by other automation #101

Description

@iwaesc

Summary

Since #97, the action replaces a PR's entire label set via PUT /issues/{n}/labels instead of adding its label via POST.

The GitHub labels API treats these differently on /issues/{n}/labels:

  • POST adds the labels in the body and leaves all others untouched.
  • PUT replaces the issue's entire label set, removing anything not in the body.

Because $comma_separated_labels is derived from an earlier snapshot GET, any label applied to the PR after that read (by another workflow or bot) is absent from the body and is therefore deleted by the PUT. This is a read-modify-write race whenever a second actor labels the same PR concurrently.

Suggested fix

Keep the add operation additive and remove only the stale size labels explicitly, rather than replacing the whole set. Roughly:

That resolves the accumulation issue #97 targeted without touching labels the action does not own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions