mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-17 11:57:12 +03:00
fix
This commit is contained in:
parent
2873c0d58d
commit
4b2c677185
@ -29,7 +29,7 @@ import (
|
||||
|
||||
var _ = Describe("E2E TEST PAT:"+checks.CheckBranchProtection, func() {
|
||||
Context("E2E TEST:Validating branch protection", func() {
|
||||
skipIfTokenIs(githubWorkflowDefaultTokenType, checks.CheckBranchProtection+" does not support GITHUB_TOKEN")
|
||||
skipIfTokenIsNot(patTokenType, "PAT only")
|
||||
|
||||
It("Should get non-admin branch protection on other repositories", func() {
|
||||
dl := scut.TestDetailLogger{}
|
||||
@ -123,3 +123,28 @@ var _ = Describe("E2E TEST PAT:"+checks.CheckBranchProtection, func() {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
var _ = Describe("E2E TEST GITHUB_TOKEN:"+checks.CheckBranchProtection, func() {
|
||||
Context("E2E TEST:Validating branch protection", func() {
|
||||
skipIfTokenIsNot(githubWorkflowDefaultTokenType, "GITHUB_TOKEN only")
|
||||
|
||||
It("Should get errors with GITHUB_TOKEN", func() {
|
||||
dl := scut.TestDetailLogger{}
|
||||
repo, err := githubrepo.MakeGithubRepo("ossf-tests/scorecard-check-branch-protection-e2e")
|
||||
Expect(err).Should(BeNil())
|
||||
repoClient := githubrepo.CreateGithubRepoClient(context.Background(), logger)
|
||||
err = repoClient.InitRepo(repo, clients.HeadSHA)
|
||||
Expect(err).Should(BeNil())
|
||||
req := checker.CheckRequest{
|
||||
Ctx: context.Background(),
|
||||
RepoClient: repoClient,
|
||||
Repo: repo,
|
||||
Dlogger: &dl,
|
||||
}
|
||||
|
||||
result := checks.BranchProtection(&req)
|
||||
Expect(result.Error).ShouldNot(BeNil())
|
||||
Expect(repoClient.Close()).Should(BeNil())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user