Skip to content

Commit 333807a

Browse files
rohankh532naveensrinivasan
authored andcommitted
enable workflow at organization level (ossf/scorecard-action#88)
* enable workflow at organization level * added more error checking * added README, minor fixes * added support for specifying repo list * skip repo checks, started writing test * dynamically pull latest workflow file * cleanup * test file resources * reverted to statically storing workflow file * removed token * updated readme * skip repo upon failure instead of exiting * renamed global var Co-authored-by: Naveen <[email protected]>
1 parent 0f5641c commit 333807a

File tree

6 files changed

+688
-0
lines changed

6 files changed

+688
-0
lines changed

action/multi-repo-action/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Enable OSSF Scorecard Action at an Organization Level
2+
3+
This tool will add the [OpenSSF's Scorecard workflow](https://github.com/ossf/scorecard-action) to all accessible repositories under a given organization. A PR will be created so that owners can decide whether or not they want to include the workflow.
4+
5+
## Setup
6+
7+
Running this tool requires three parameters, which are defined at the top of `org-workflow-add.go`:
8+
1. ORG_NAME - the name of the organization for which the workflow should be enabled.
9+
2. PAT - a Personal Access Token with the following scopes:
10+
- `repo > public_repo`
11+
- `admin:org > read:org`
12+
3. REPO_LIST (OPTIONAL) - repository names under the organization that the workflow should be added to. If not provided, every repository will be updated.
13+
14+
Another PAT should also be defined as an organization secret for `scorecards-analysis.yml` using steps listed in [scorecard-action](https://github.com/ossf/scorecard-action#pat-token-creation).
15+
16+
## Execution
17+
18+
Execute this process by running `go run org-workflow-add.go` in the command line. Output will be produced for each successfully updated repository.

action/multi-repo-action/go.mod

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module github.com/ossf/scorecard-actions/cli
2+
3+
go 1.17
4+
5+
require (
6+
github.com/google/go-github/v42 v42.0.0
7+
github.com/migueleliasweb/go-github-mock v0.0.6
8+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
9+
)
10+
11+
require (
12+
github.com/golang/protobuf v1.4.2 // indirect
13+
github.com/google/go-github/v41 v41.0.0 // indirect
14+
github.com/google/go-querystring v1.1.0 // indirect
15+
github.com/gorilla/mux v1.8.0 // indirect
16+
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
17+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
18+
google.golang.org/appengine v1.6.7 // indirect
19+
google.golang.org/protobuf v1.25.0 // indirect
20+
)

0 commit comments

Comments
 (0)