Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repository preferences to the context #1307

Closed
wants to merge 2 commits into from

Conversation

dsame
Copy link

@dsame dsame commented Jan 10, 2023

To solve this issue actions/stale#881 it is necessary to detect is the current repository forked from the another.

This PR introduces new getter to github's Context called "repositoryPreferences" with the only property "isFork".

Alternatives:

  1. to do not introduce this property at all (cancel this PR), just access the payload directly from actions/stale repo. PROS: simplicity, consistency with GitHub REST API, CONS: actions/stale never accesses payload property of the context.
  2. to add isFork to repo getter (not introduce repositoryPreferences). PROS: seems to be obvious, CONS: I assume semantic of the repo is not "repository" but rather "id of the repository". Particularly repo may exist before the payload initialised.
  3. to rename repositoryPreferences to repository and isFork to fork. PROS: to be in consistency with GitHub REST API, CONS: it is not clear what would be difference between repo and repository; from the fork name it is not obvious the property is boolean.

@dsame dsame marked this pull request as ready for review January 11, 2023 02:46
@dsame dsame requested a review from a team as a code owner January 11, 2023 02:46
@dsame
Copy link
Author

dsame commented Jan 19, 2023

It was decided to use 1st alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant