Action db update#1025
Conversation
|
Why am I feeling nervous? 😂 |
nope nope, it's for me to filter out important issue first 😁😁 |
kaustubhgupta
left a comment
There was a problem hiding this comment.
A couple of changes:
| @@ -36,3 +36,38 @@ _Please delete options that are not relevant._ | |||
| - [ ] My documentation follows [`Template for README.md`](https://github.com/avinashkranjan/Amazing-Python-Scripts/blob/master/Template%20for%20README.md) | |||
| - [ ] My changes generate no new warnings | |||
| - [ ] I have added tests/screenshots(if any) that prove my fix is effective or that my feature works. | |||
There was a problem hiding this comment.
Add a new check point for this:
- I have added the project meta data in the PR template.
| - [ ] My changes generate no new warnings | ||
| - [ ] I have added tests/screenshots(if any) that prove my fix is effective or that my feature works. |
There was a problem hiding this comment.
remove these two points
| @@ -14,6 +14,9 @@ | |||
| parser = OptionParser() | |||
There was a problem hiding this comment.
Rename this file to manual db updater
|
@XZANATOL I can't see your new commits. Only the previous 2 commits are visible |
|
I didn't make any commits yet, check the comments on the changes you requested. |
there are no comments from your side on those changes |
XZANATOL
left a comment
There was a problem hiding this comment.
oh I didn't realize that I should submit the conversations xd my bad
|
Ah right.. after merging the action we can directly test it from my other openned PR #1002 , I've edited it's PR body and after merging you can directly test it out (if I wasn't online at that time.) |
|
|
||
| `` If there is no-file/nothing to fill the below fields with, then type: none `` | ||
|
|
||
| `` Example: `` If no requirements.txt needed/present then type in ``Requirments`` none => ``Requirments: none`` |
There was a problem hiding this comment.
Umm, I have a question here, According to the regex rule you have in line 10:
requirments_path = r"Requirments: (.+)"
I think it will capture this value irrespective of the case where I am providing a path to file in line 62 in this PR template. This will make every entry in the database none for requirements. I think you can restructure this line as:
| `` Example: `` If no requirements.txt needed/present then type in ``Requirments`` none => ``Requirments: none`` | |
| `` Example: `` If no requirements.txt needed/present, then type none in ``Requirments``. |
There was a problem hiding this comment.
Actually there is no need to worry here. I'm using re.match() method not re.search() to get the contents. re.match() will match the whole string not search inside of it.. it's like ==
There was a problem hiding this comment.
Yes, I realized this after running through multiple test
| print("[+] PyGithub Login Success!") | ||
| repo = git.get_repo("avinashkranjan/Amazing-Python-Scripts") | ||
| datastore_file = repo.get_contents("./Master Script/datastore.json") | ||
| repo.update_file(datastore_file.path, "Updated datastore.json", data_store, datastore_file.sha, branch="main") |
There was a problem hiding this comment.
A major error:
| repo.update_file(datastore_file.path, "Updated datastore.json", data_store, datastore_file.sha, branch="main") | |
| repo.update_file(datastore_file.path, "Updated datastore.json", data_store, datastore_file.sha, branch="master") |
There was a problem hiding this comment.
Oh.. my bad on that one.. I always get confused between them. xd
There was a problem hiding this comment.
No issues, I have fixed this
|
Also, check out this log: https://github.com/kaustubhgupta/gitpractise/runs/2545434245?check_suite_focus=true The file is not being pushed to the gh-pages branch as the sha values are not matching for both branches. I think you need to get the contents of the master branch and gh-pages branch separately and then use the .update_file method to push the files |
|
@XZANATOL Never mind, I have handled these errors and committed the same. |
|
Hi, have just got home.. xd |
|
@XZANATOL Finally the script worked successfully on this repo: https://github.com/kaustubhgupta/gitpractise After 12 PRs xd |
|
I think this is the hardest challenge I've ever faced. tho it was fun! xD |
avinashkranjan
left a comment
There was a problem hiding this comment.
LGTM..Great Work Guys @XZANATOL & @kaustubhgupta
|
@kaustubhgupta just before forgetting, can you add GSSOC labels? xd + test the action in #1002 |
Done ✅ |
Description
Added GitHub action files to automatically update JSON database in
./Master Scriptdirectory.Fixes number #831
Didn't correctly link the issue to not auto close itHave you read the Contributing Guidelines on Pull Requests?
Type of change
Please delete options that are not relevant.
Checklist:
README.mdTemplate for README.md