Skip to content

Commit a88cb7a

Browse files
authored
add ci jobs urls to the github configs (#95)
* add ci jobs urls to the github configs * more * more
1 parent aea2dd0 commit a88cb7a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ Under the hood, this config adds these allowlist items:
102102
- GET `https://github.example.com/api/v3/users/:user/installation`
103103
- GET `https://github.example.com/api/v3/users/:user/installation/repositories`
104104
- GET `https://github.example.com/api/v3/app`
105+
- GET `https://github.example.com/api/v3/repos/:org/:repo/actions/secrets/public-key`
106+
- GET `https://github.example.com/api/v3/repos/:org/:repo/contents/.github/workflows/semgrep.yml`
107+
- PUT `https://github.example.com/api/v3/repos/:org/:repo/contents/.github/workflows/semgrep.yml`
108+
- PUT `https://github.example.com/api/v3/repos/:org/:repo/actions/secrets/SEMGREP_APP_TOKEN`
105109
- POST `https://github.example.com/api/v3/app/installations/:id/access_tokens`
106110
- POST `https://github.example.com/api/v3/app-manifests/:code/conversions`
107111
- POST `https://github.example.com/api/v3/repos/:owner/:repo/pulls/:number/comments`

pkg/config.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,23 @@ func LoadConfig(configFiles []string, deploymentId int) (*Config, error) {
486486
URL: gitHubBaseUrl.JoinPath("/app/installations/:id/access_tokens").String(),
487487
Methods: ParseHttpMethods([]string{"POST"}),
488488
SetRequestHeaders: headers,
489-
})
489+
},
490+
AllowlistItem{
491+
URL: gitHubBaseUrl.JoinPath("/repos/:org/:repo/actions/secrets/SEMGREP_APP_TOKEN").String(),
492+
Methods: ParseHttpMethods([]string{"PUT"}),
493+
SetRequestHeaders: headers,
494+
},
495+
AllowlistItem{
496+
URL: gitHubBaseUrl.JoinPath("/repos/:org/:repo/actions/secrets/public-key").String(),
497+
Methods: ParseHttpMethods([]string{"GET"}),
498+
SetRequestHeaders: headers,
499+
},
500+
AllowlistItem{
501+
URL: gitHubBaseUrl.JoinPath("/repos/:org/:repo/contents/.github/workflows/semgrep.yml").String(),
502+
Methods: ParseHttpMethods([]string{"GET", "PUT"}),
503+
SetRequestHeaders: headers,
504+
},
505+
)
490506

491507
if config.Inbound.GitHub.AllowCodeAccess {
492508
config.Inbound.Allowlist = append(config.Inbound.Allowlist,

0 commit comments

Comments
 (0)