You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+151-3Lines changed: 151 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,87 @@
1
1
# Measure InnerSource tool
2
2
3
-
This tool measures InnerSource collaboration in a given repository by analyzing issues, pull requests, and contributions.
3
+
This tool measures InnerSource collaboration in a given repository by analyzing issues, pull requests, and code contributions. It helps organizations track and improve their InnerSource adoption by quantifying the collaboration between different teams and departments.
4
+
5
+
## What is InnerSource?
6
+
7
+
InnerSource applies open source principles and practices to internal development. It involves teams contributing to projects owned by other teams within the same organization, fostering collaboration, knowledge sharing, and code reuse across organizational boundaries. See [the InnerSource Commons Foundation's site](https://innersourcecommons.org) for more details.
8
+
9
+
## How This Tool Works
10
+
11
+
The measure-innersource tool:
12
+
13
+
1. Identifies the original repository owner(s) and their organizational structure
14
+
2. Analyzes all contributors to the repository
15
+
3. Classifies contributors as either team members or InnerSource contributors (from outside the team responsible for the repository)
16
+
4. Counts contributions (commits, PRs, issues) from both groups
17
+
5. Calculates an InnerSource collaboration ratio
18
+
6. Generates a detailed Markdown report
19
+
20
+
### Organization Data
21
+
22
+
This tool requires an `org-data.json` file in the root of the repository that contains organizational hierarchy information. This file maps GitHub usernames to their managers, allowing the tool to determine team boundaries.
23
+
24
+
Example format of `org-data.json`:
25
+
26
+
```json
27
+
{
28
+
"username1": {
29
+
"manager": "manager1"
30
+
},
31
+
"username2": {
32
+
"manager": "manager1"
33
+
},
34
+
"username3": {
35
+
"manager": "manager2"
36
+
}
37
+
}
38
+
```
4
39
5
40
## Sample Report
6
41
42
+
Below is an example of the generated InnerSource report:
43
+
44
+
```markdown
45
+
# InnerSource Report
46
+
47
+
## Repository: octocat/hello-world
48
+
49
+
### InnerSource Ratio: 35.67%
50
+
51
+
### Original Commit Author: octocat (Manager: octoboss)
52
+
53
+
## Team Members that Own the Repo:
54
+
55
+
- octocat
56
+
- octoboss
57
+
- octodev1
58
+
- octodev2
59
+
60
+
## All Contributors:
61
+
62
+
- octocat
63
+
- octodev1
64
+
- octodev2
65
+
- contributor1
66
+
- contributor2
67
+
68
+
## Innersource Contributors:
69
+
70
+
- contributor1
71
+
- contributor2
72
+
73
+
## Innersource Contribution Counts:
74
+
75
+
- contributor1: 15 contributions
76
+
- contributor2: 8 contributions
77
+
78
+
## Team Member Contribution Counts:
79
+
80
+
- octocat: 25 contributions
81
+
- octodev1: 12 contributions
82
+
- octodev2: 5 contributions
83
+
```
84
+
7
85
## Support
8
86
9
87
If you need support using this project or have questions about it, please [open up an issue in this repository](https://github.com/github/measure-innersource/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.
@@ -15,12 +93,40 @@ All feedback regarding our GitHub Actions, as a whole, should be communicated th
15
93
## Use as a GitHub Action
16
94
17
95
1. Create a repository to host this GitHub Action or select an existing repository. This is easiest with regards to permissions if it is the same repository as the one you want to measure innersource collaboration on.
18
-
2.Select a best fit workflow file from the [examples directory](./docs/example-workflows.md) for your use case.
19
-
3. Copy that example into your repository (from step 1) and into the proper directory for GitHub Actions: `.github/workflows/` directory with the file extension `.yml` (ie. `.github/workflows/measure-innersource.yml`)
96
+
2.**Create an org-data.json file** in the root of your repository with your organization structure as described above.
97
+
3. Copy the example below (in the next section) into your repository (from step 1) and into the proper directory for GitHub Actions: `.github/workflows/` directory with the file extension `.yml` (ie. `.github/workflows/measure-innersource.yml`)
20
98
4. Update the workflow file with the appropriate configuration options as described below. The required configuration options are `REPOSITORY`, `GH_APP_ID`, `GH_APP_INSTALLATION_ID`, and `GH_APP_PRIVATE_KEY` for GitHub App Installation authentication, or `REPOSITORY` and `GH_TOKEN` for Personal Access Token (PAT) authentication. The other configuration options are optional.
21
99
5. Commit the workflow file to the default branch (often `master` or `main`)
22
100
6. Wait for the action to trigger based on the `schedule` entry or manually trigger the workflow as shown in the [documentation](https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow).
23
101
102
+
### Basic Workflow Example
103
+
104
+
Here's a simple example workflow file to get you started:
105
+
106
+
```yaml
107
+
name: Measure InnerSource Collaboration
108
+
109
+
on:
110
+
schedule:
111
+
- cron: "0 0 * * 0"# Run weekly on Sundays at midnight
112
+
workflow_dispatch: # Allow manual triggers
113
+
114
+
jobs:
115
+
measure-innersource:
116
+
runs-on: ubuntu-latest
117
+
steps:
118
+
- name: Checkout code
119
+
uses: actions/checkout@v4
120
+
121
+
- name: Measure InnerSource
122
+
uses: github/measure-innersource@v1
123
+
env:
124
+
REPOSITORY: "owner/repo"
125
+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
126
+
REPORT_TITLE: "Weekly InnerSource Report"
127
+
OUTPUT_FILE: "innersource_report.md"
128
+
```
129
+
24
130
### Configuration
25
131
26
132
Below are the allowed configuration options:
@@ -54,6 +160,48 @@ This action can be configured to authenticate with GitHub App Installation or Pe
54
160
| `REPORT_TITLE` | False | `"InnerSource Report"` | Title to have on the report issue. |
55
161
| `REPOSITORY` | True | `""` | The name of the repository you are trying to measure. Format `owner/repo` ie. `github/measure-innersource` |
56
162
163
+
## Understanding the Results
164
+
165
+
The generated report includes several key metrics:
166
+
167
+
### InnerSource Ratio
168
+
169
+
This is calculated as:
170
+
171
+
```markdown
172
+
InnerSource Ratio = (Total InnerSource Contributions) / (Total Contributions)
173
+
```
174
+
175
+
Where:
176
+
177
+
- Total InnerSource Contributions = Sum of all contributions from users outside the repository's owning team
178
+
- Total Contributions = Sum of all contributions to the repository
179
+
180
+
A higher ratio indicates more cross-team collaboration.
181
+
182
+
### Team Ownership Determination
183
+
184
+
The tool determines team ownership by:
185
+
186
+
1. Identifying the original commit author
187
+
2. Finding the original author's manager from org-data.json
188
+
3. Including all users who report to the same manager in the team
189
+
4. Including all users who report to anyone in the team
190
+
191
+
### Use Cases
192
+
193
+
- **Track InnerSource adoption over time**: Run this action on a schedule to see if your InnerSource initiative is gaining traction
194
+
- **Compare InnerSource collaboration across repositories**: Run on multiple repositories to identify which ones have the most cross-team collaboration
195
+
- **Identify key InnerSource contributors**: Recognize individuals who contribute across team boundaries
196
+
- **Measure the impact of InnerSource initiatives**: Track the change in metrics before and after implementing InnerSource practices
197
+
198
+
## Limitations
199
+
200
+
- Requires accurate organization data in the org-data.json file
201
+
- Cannot detect team relationships beyond what's specified in the org-data.json file
202
+
- Historical team changes are not accounted for (uses current team structure only)
203
+
- Bot accounts should have "[bot]" in their username to be excluded from calculations
204
+
57
205
## Contributions
58
206
59
207
We would ❤️ contributions to improve this action. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for how to get involved.
0 commit comments