Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jimmyh-onepilot opened this issue Mar 8, 2024 · 2 comments

Comments

@jimmyh-onepilot
Copy link

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!

@delucis
Copy link
Owner

delucis commented Mar 10, 2024

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

@jimmyh-onepilot
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants