Add repository preferences to the context #1307
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
actions/stale
repo. PROS: simplicity, consistency with GitHub REST API, CONS:actions/stale
never accesses payload property of the context.isFork
torepo
getter (not introducerepositoryPreferences
). PROS: seems to be obvious, CONS: I assume semantic of therepo
is not "repository" but rather "id of the repository". Particularlyrepo
may exist before thepayload
initialised.repositoryPreferences
torepository
andisFork
tofork
. PROS: to be in consistency with GitHub REST API, CONS: it is not clear what would be difference betweenrepo
andrepository
; from thefork
name it is not obvious the property is boolean.