-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script upgrades and updated CONTRIBUTING.md and README.md (#576)
* Updated README and CONTRIBUTING * Added check for devicon object when peeking * Added PR template * Added a script to create release messages * Updated CONTRIBUTING about new script * Update .github/PULL_REQUEST_TEMPLATE/new_icon.md Co-authored-by: David Leal <[email protected]> * Update .github/scripts/build_assets/arg_getters.py Co-authored-by: David Leal <[email protected]> * Update .github/workflows/get_release_message.yml Co-authored-by: David Leal <[email protected]> * Update gulpfile.js Co-authored-by: David Leal <[email protected]> * Update .github/PULL_REQUEST_TEMPLATE/new_feature.md Co-authored-by: David Leal <[email protected]> * Update .github/PULL_REQUEST_TEMPLATE/new_feature.md Co-authored-by: David Leal <[email protected]> * Added a way for peek bot to comment error * Update CONTRIBUTING.md Co-authored-by: Clemens Bastian <[email protected]> * Update .github/scripts/get_release_message.py Co-authored-by: Malte Jürgens <[email protected]> * Update .github/scripts/get_release_message.py Co-authored-by: Malte Jürgens <[email protected]> * Update .github/PULL_REQUEST_TEMPLATE/new_feature.md Co-authored-by: David Leal <[email protected]> * Clean up and updated CONTRIBUTING * Updated CONTRIBUTING * Add set up steps for release message workflow * Refactored peek workflow * Added requests library * Reformat devicon object error messages Co-authored-by: David Leal <[email protected]> Co-authored-by: Clemens Bastian <[email protected]> Co-authored-by: Malte Jürgens <[email protected]>
- Loading branch information
1 parent
be0f017
commit 41790e6
Showing
14 changed files
with
266 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## This PR adds... | ||
|
||
*List your features here and their reasons for creation.* | ||
|
||
## Notes | ||
|
||
*List anything note-worthy here (potential issues, this needs merge to `master` before working, etc....).* | ||
|
||
*Don't forget to link any issues that this PR will solved.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
**Double check these details before you open a PR** | ||
|
||
- [] PR does not match another non-stale PR currently opened | ||
- [] PR name matches the format *new icon: <i>Icon name</i> (<i>versions separated by comma</i>)* as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#overview) | ||
- [] Your icons are put in a folder as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#organizational-guidelines) | ||
- [] SVG matches the standards laid out [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#svgStandards) | ||
- [] A new object is added in the `devicon.json` file as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#-updating-the-deviconjson-) | ||
|
||
Refer to the [`CONTRIBUTING.md`](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#contributing-to-devicon) for more details. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import requests | ||
from build_assets import arg_getters | ||
import re | ||
|
||
def main(): | ||
print("Please wait a few seconds...") | ||
args = arg_getters.get_release_message_args() | ||
queryPath = "https://api.github.com/repos/devicons/devicon/pulls?accept=application/vnd.github.v3+json&state=closed&per_page=100" | ||
stopPattern = r"^(r|R)elease v" | ||
headers = { | ||
"Authorization": f"token {args.token}" | ||
} | ||
|
||
response = requests.get(queryPath, headers=headers) | ||
if not response: | ||
print(f"Can't query the GitHub API. Status code is {response.status_code}. Message is {response.text}") | ||
return | ||
|
||
data = response.json() | ||
newIcons = [] | ||
features = [] | ||
|
||
for pullData in data: | ||
if re.search(stopPattern, pullData["title"]): | ||
break | ||
|
||
authors = findAllAuthors(pullData, headers) | ||
markdown = f"- [{pullData['title']}]({pullData['html_url']}) by {authors}." | ||
|
||
if isFeatureIcon(pullData): | ||
newIcons.append(markdown) | ||
else: | ||
features.append(markdown) | ||
|
||
thankYou = "A huge thanks to all our maintainers and contributors for making this release possible!" | ||
iconTitle = "**{} New Icons**\n".format(len(newIcons)) | ||
featureTitle = "**{} New Features**\n".format(len(features)) | ||
finalString = "{0}\n\n {1}{2}\n\n {3}{4}".format(thankYou, | ||
iconTitle, "\n".join(newIcons), featureTitle, "\n".join(features)) | ||
|
||
print("--------------Here is the build message--------------\n", finalString) | ||
|
||
|
||
""" | ||
Check whether the pullData is a feature:icon PR. | ||
:param pullData | ||
:return true if the pullData has a label named "feature:icon" | ||
""" | ||
def isFeatureIcon(pullData): | ||
for label in pullData["labels"]: | ||
if label["name"] == "feature:icon": | ||
return True | ||
return False | ||
|
||
|
||
""" | ||
Find all the authors of a PR based on its commits. | ||
:param pullData - the data of a pull request. | ||
""" | ||
def findAllAuthors(pullData, authHeader): | ||
response = requests.get(pullData["commits_url"], headers=authHeader) | ||
if not response: | ||
print(f"Can't query the GitHub API. Status code is {response.status_code}") | ||
print("Response is: ", response.text) | ||
return | ||
|
||
commits = response.json() | ||
authors = set() # want unique authors only | ||
for commit in commits: | ||
authors.add("@" + commit["author"]["login"]) | ||
return ", ".join(list(authors)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
selenium==3.141.0 | ||
selenium==3.141.0 | ||
requests==2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Get Release Message | ||
on: workflow_dispatch | ||
jobs: | ||
build: | ||
name: Get Fonts From Icomoon | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python v3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r ./.github/scripts/requirements.txt | ||
- name: Run the get_release_message.py | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: python ./.github/scripts/get_release_message.py $GITHUB_TOKEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,14 @@ jobs: | |
with: | ||
path: ./pr_num/pr_num.txt | ||
|
||
- name: Read the err message file | ||
if: success() | ||
id: err_message_reader | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ./err_messages/err_messages.txt | ||
|
||
|
||
- name: Upload screenshot of the newly made icons gotten from the artifacts | ||
id: icons_overview_img_step | ||
if: env.PEEK_STATUS == 'success' && success() | ||
|
@@ -87,20 +95,24 @@ jobs: | |
MESSAGE: | | ||
Hi there, | ||
I'm Devicons' Peek Bot and it seems we've ran into a problem (sorry!). | ||
I'm Devicons' Peek Bot and it seems we've ran into a problem. | ||
``` | ||
{0} | ||
``` | ||
Please double check and fix the possible issues below: | ||
Make sure that: | ||
- Your svgs are named and added correctly to the /icons folder as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#orgGuidelines). | ||
- Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#updateDevicon) | ||
- Your PR title follows the format seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview) | ||
I will retry once everything is fixed. If I still fail (sorry!) or there are other erros, the maintainers will investigate. | ||
I will retry once everything is fixed. If I still fail or there are other error, the maintainers will investigate. | ||
Best of luck, | ||
Peek Bot :relaxed: | ||
with: | ||
type: create | ||
issue_number: ${{ steps.pr_num_reader.outputs.content }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
body: ${{ env.MESSAGE }} | ||
body: ${{ format(env.MESSAGE, steps.err_message_reader.outputs.content) }} |
Oops, something went wrong.