Skip to content

Commit f781e36

Browse files
authored
Merge pull request #28 from 3cpt/main
2 parents b7fe0aa + a3aa746 commit f781e36

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# InnerSource Crawler
2+
23
![.github/workflows/linter.yml](https://github.com/zkoppert/innersource-crawler/actions/workflows/linter.yml/badge.svg) ![CodeQL](https://github.com/zkoppert/innersource-crawler/actions/workflows/codeql-analysis.yml/badge.svg)
34

45
This project creates a `repos.json` that can be utilized by the [SAP InnerSource Portal][SAP-InnerSource-Portal]. The current approach assumes that the repos that you want to show in the portal are available in a GitHub organization, and that they all are tagged with a certain _topic_.
56

67
## Support
8+
79
If you need support using this project or have questions about it, please [open up an issue in this repository](https://github.com/zkoppert/innersource-crawler/issues). Requests made directly to GitHub staff or support team will be redirected here to open an issue. GitHub SLA's and support/services contracts do not apply to this repository.
810

911
## Use as a GitHub Action
@@ -15,6 +17,7 @@ Note: Your GitHub token will need to have read/write access to all the repositor
1517
1. Don't forget to do something with the resulting `repos.json` file. You can [move it to another repository](https://github.com/marketplace/actions/push-a-file-to-another-repository) if needed or [save it as a build artifact](https://github.com/actions/upload-artifact). This will all depend on what you are doing with it and what repository you are running this action out of.
1618

1719
### Example workflow
20+
1821
```yaml
1922
name: InnerSource repo crawler
2023

@@ -54,4 +57,5 @@ jobs:
5457
[SAP-InnerSource-Portal]: https://github.com/sap/project-portal-for-InnerSource
5558

5659
## License
60+
5761
[MIT](LICENSE)

crawler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from os.path import dirname, join
77

88
import github3
9+
import repo_activity.score
910
from dotenv import load_dotenv
1011

1112
if __name__ == "__main__":
@@ -69,6 +70,9 @@
6970
topics = repo.repository.topics()
7071
innersource_repo["_InnerSourceMetadata"]["topics"] = topics.names
7172

73+
# calculate score
74+
innersource_repo["score"] = repo_activity.score.calculate(innersource_repo)
75+
7276
repo_list.append(innersource_repo)
7377

7478
# Write each repository to a repos.json file

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
github3.py==3.0.0
22
python-dotenv==0.19.2
3+
repo-activity-score==0.0.4

0 commit comments

Comments
 (0)