|
3 | 3 |
|
4 | 4 | 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_.
|
5 | 5 |
|
6 |
| -## Installation |
| 6 | +## Support |
| 7 | +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. |
7 | 8 |
|
8 |
| -`pip install -r requirements.txt` |
| 9 | +## Use as a GitHub Action |
9 | 10 |
|
10 |
| -## Usage |
| 11 | +1. Create a repository to host this GitHub Action |
| 12 | +1. Create the env values from the sample workflow below (GH_TOKEN, ORGANIZATION) with your information as repository secrets. More info on creating secrets can be found [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets). |
| 13 | +Note: Your GitHub token will need to have read/write access to all the repositories in the organization |
| 14 | +1. Copy the below example workflow to your repository and put it in the `.github/workflows/` directory with the file extension `.yml` (ie. `.github/workflows/crawler.yml`) |
| 15 | + |
| 16 | +### Example workflow |
| 17 | +```yaml |
| 18 | +name: InnerSource repo crawler |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_dispatch: |
| 22 | + schedule: |
| 23 | + - cron: '00 5 * * *' |
| 24 | + |
| 25 | +jobs: |
| 26 | + build: |
| 27 | + name: InnerSource repo crawler |
| 28 | + runs-on: ubuntu-latest |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@v2 |
| 33 | + |
| 34 | + - name: Run crawler tool |
| 35 | + uses: docker://ghcr.io/zkoppert/innersource-crawler:v1 |
| 36 | + env: |
| 37 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 38 | + ORGANIZATION: ${{ secrets.ORGANIZATION }} |
| 39 | + TOPIC: inner-source |
| 40 | +``` |
| 41 | +
|
| 42 | +## Local usage |
11 | 43 |
|
12 | 44 | 1. Copy `.env-example` to `.env`
|
13 | 45 | 1. Fill out the `.env` file with a _token_ from a user that has access to the organization to scan (listed below). Tokens should have admin:org or read:org access.
|
14 | 46 | 1. Fill out the `.env` file with the exact _topic_ name you are searching for
|
15 | 47 | 1. Fill out the `.env` file with the exact _organization_ that you want to search in
|
16 | 48 | 1. (Optional) Fill out the `.env` file with the exact _URL_ of the GitHub Enterprise that you want to search in. Keep empty if you want to search in the public `github.com`.
|
| 49 | +1. `pip install -r requirements.txt` |
17 | 50 | 1. Run `python3 ./crawler.py`, which will create a `repos.json` file containing the relevant metadata for the GitHub repos for the given _topic_
|
18 | 51 | 1. Copy `repos.json` to your instance of the [SAP-InnerSource-Portal][SAP-InnerSource-Portal] and launch the portal as outlined in their installation instructions
|
19 | 52 |
|
|
0 commit comments