Skip to content

Commit fe11785

Browse files
authored
Update documentation for Actions usage
Signed-off-by: GitHub <[email protected]>
1 parent 375953b commit fe11785

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,50 @@
33

44
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_.
55

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.
78

8-
`pip install -r requirements.txt`
9+
## Use as a GitHub Action
910

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
1143
1244
1. Copy `.env-example` to `.env`
1345
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.
1446
1. Fill out the `.env` file with the exact _topic_ name you are searching for
1547
1. Fill out the `.env` file with the exact _organization_ that you want to search in
1648
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`
1750
1. Run `python3 ./crawler.py`, which will create a `repos.json` file containing the relevant metadata for the GitHub repos for the given _topic_
1851
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
1952

0 commit comments

Comments
 (0)