mirror of
https://github.com/peakoss/anti-slop
synced 2026-11-28 13:37:41 +08:00
refactor(context): read owner and repo from payload
- switch from `github.context.repo` (which reads the `GITHUB_REPOSITORY` env var) to reading the repository owner and name from the webhook payload. - aligns with how all other context data is already read. - needed for a future ecosystem CI where event payloads from different repositories will be used as fixtures. - also simplifies local testing since `GITHUB_REPOSITORY` no longer needs to be set manually.
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -12,8 +12,8 @@ export function buildContext(): Context {
|
||||
core.debug(`Payload:\n${JSON.stringify(payload, null, 2)}`);
|
||||
|
||||
return {
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
owner: payload.repository.owner.login,
|
||||
repo: payload.repository.name,
|
||||
|
||||
repoUrl: pr.base.repo.html_url,
|
||||
|
||||
|
||||
Reference in new issue
Block a user