smartcontractkit / chainlink-github-actions

Common action to run chainlink-testing-framework based tests in github ci

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

utils/wait-for-workflow crashing when repo belongs to a personal account and not an organization

RupertBarrow opened this issue · comments

I am using utils/wait-for-workflow in a repo under my personal account.

The context being sent to the GHA is the following :

context: Context {
  payload: {
    action: 'closed',
    number: 215,
    pull_request: {
		...
    },
    repository: {
		...
	},
	sender: {
			...
	      login: 'RupertBarrow',
			...
	      type: 'User',
	      url: 'https://api.github.com/users/RupertBarrow'
    }
  },
  eventName: 'pull_request_target',
  sha: 'xxx',
  ref: 'refs/heads/release',
  workflow: 'Backport',
  action: 'wait',
  actor: 'RupertBarrow',
  job: 'waitForRelease',
}

In your code (https://github.com/smartcontractkit/chainlink-github-actions/blob/main/utils/wait-for-workflows/action.yml#L45C15-L45C56), your are expecting a context.payload.organization (in context.payload.organization.login) but I am only sending a context.payload.sender (presumaby because I am working on a repo in my personal account, not part of an organization ?)

Line 45 should be
owner: context.payload.organization?.login || context.payload.sender?.login,
instead of
owner: context.payload.organization.login,

I will send you a PR.