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

Code links missing relative paths in template? #189

Open
jywarren opened this issue Feb 26, 2018 · 6 comments
Open

Code links missing relative paths in template? #189

jywarren opened this issue Feb 26, 2018 · 6 comments

Comments

@jywarren
Copy link
Contributor

jywarren commented Feb 26, 2018

Hi, we're VERY happy uses of this bot -- it's AMAZING!

I noticed in a recent PR that the link to code is not quite right.

publiclab/plots2#2398

See app/models/node.rb links to https://github.com/publiclab/plots2/blob/master/node.rb in the Step By Step item.

It's supposed to link to: https://github.com/publiclab/plots2/blob/master/app/models/node.rb

Do we have this set up wrong?

[$FILENAME]($BRANCH_URL) is in our config file: https://github.com/publiclab/plots2/blob/master/.github/first-timers-issue-template.md

What variables are allowed in there? And I can't seem to find the example file anymore, has this changed?

Thanks so much!!!

@jywarren jywarren changed the title Code links missing relative paths Code links missing relative paths in template? Feb 26, 2018
@gr2m
Copy link
Contributor

gr2m commented Feb 26, 2018

These are the placeholders we got so far:

https://github.com/hoodiehq/first-timers-bot/blob/8d327baf23ac89962566e6bdf6e52a1b4e1c55f3/lib/create-issue.js#L5-L9

I guess $FILENAME should contain the whole path, not only the file name, I guess that is the problem.

Do you want to take a stab and try to send a pull request to fix it? It's odd because I thought the filename would already contain the whole path. This is the REST API endpoint we are using:
https://developer.github.com/v3/repos/commits/#get-a-single-commit

@jywarren
Copy link
Contributor Author

jywarren commented Feb 26, 2018 via email

@jywarren
Copy link
Contributor Author

This commit dates from Oct 11 2017... could this be related?

ccddf30#diff-5386adb7a1fcd68387c4b69ec28eb4b0R14

@jywarren
Copy link
Contributor Author

I think i have this, working on regex now... :-)

@jywarren
Copy link
Contributor Author

Yes - opening PR now:

"https://github.com/publiclab/plots2/blob/master/app/models/node.rb".replace(/(?:blob\/)(\w+)/g, "blob/my-branch")

@jywarren
Copy link
Contributor Author

Test and fix in different commits in #192.

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