Skip to content

🛠 Tooling: Default octokit owner and repo to locator #60

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Tooling Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Right now, the octokit provided to rules & used in various internal places requires manually specifying owner and repo:

await octokit.rest.issues.deleteComment({
comment_id: existingComment.id,
owner: locator.owner,
repo: locator.repository,
});

This is inconvenient - it means a locator must be passed around to rules and many places internally. I'd like to set the octokit: Octokit to default owner and repo to the locator, so we don't need to pass locator around so much.

Additional Info

I have a vague memory of this being possible with a .defaults() API. But https://octokit.github.io/rest.js/v21 doesn't mention such a thing. This might need a custom plugin.

🗺

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: toolingManaging the repository's maintenance 🛠️status: accepting prsPlease, send a pull request to resolve this! 🙏

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions