Skip to content
Discussion options

You must be logged in to vote

Hi! Is it still relevant?

I came with 2 suggestions regarding your need.

First

You can manually create a test PR, look at its ID and put this ID into options githubContext:

options.setGithubContext({ payload: { pull_request: { number: YOUR_HARDCODED_ID } } })

This way you don't need to mock API.

You can even use a separate repo if you don't like bloating your main repo. In this case use

options.setGithubContext({ 
    payload: { pull_request: { number: YOUR_HARDCODED_ID } },
    repository: 'owner/repo'
})

Second

You can extract the code of your action into a function and call it passing API client:

export async function runAction(apiClient) { 
   ... 
}

runAction(new Octokit({ auth: token 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jrson83
Comment options

Comment options

You must be logged in to vote
1 reply
@jrson83
Comment options

Answer selected by cardinalby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants