github-to-linear icon indicating copy to clipboard operation
github-to-linear copied to clipboard

Feat - Link the pull req. with Linear automation (could be easy but to investigate)

Open jimmyh-onepilot opened this issue 1 year ago • 2 comments

Context

Idea would be to add the ID from the created issue (on Linear) directly at the end of the description from the pull request.

E.g.: "Closes FOO-2332."

So basically the Linear issue would be linked to the pull req.

Otherwise the add-on is great guys, great job!

jimmyh-onepilot avatar Mar 08 '24 16:03 jimmyh-onepilot

This could be do-able, but would require a relatively high-privilege GitHub access token to modify the pull request — currently the extension requests a Linear access token, but isn’t authorized with GitHub.

Unless there’s a way to script it from the page, e.g. a button to “Mark as closing FOO-2332” which when clicked edits and saves the PR description for you. That might work — wouldn’t be automated, but could be one click away.


Edit: yes, just confirmed this could be possible:

const issueBody = document.querySelector('.js-command-palette-issue-body');
const editButton = issueBody.querySelector('.js-comment-edit-button');
editButton.click();
const editForm = issueBody.querySelector('.js-comment-update');
const textarea = editForm.querySelector('textarea');
// modify textarea.value
editForm.submit(); // N.B. reloads the page

delucis avatar Mar 10 '24 00:03 delucis

Nice! How could I proceed to make it on my own usage?

jimmyh-onepilot avatar May 23 '24 13:05 jimmyh-onepilot