Skip to content

Commit e0c2abe

Browse files
authored
Merge pull request #41 from eksrvb/bugfix/permission-check-major-comment
add permission check major comment
2 parents cf0c019 + 38dbfe6 commit e0c2abe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ The patching of the version only takes effect if the merged branch begins with t
2828
2929
| SemVer | supported aliases | version example |
3030
| ------ | ------------------------------------------- | --------------- |
31-
| MAJOR | `comment PR` | 1.2.3 => 2.0.0 |
31+
| MAJOR | [comment PR`](#major-specialties) | 1.2.3 => 2.0.0 |
3232
| MINOR | feature | 1.2.3 => 1.3.0 |
3333
| PATCH | bugfix | 1.2.3 => 1.2.4 |
3434

3535
![awesome-ci workflow](aci-workflow.drawio.png "awesome-ci workflow")
3636

3737
> Hint: this tool automatically detects your environment. Supported are __Jenkins__, __GitHub Actions__ and __GitLab CI__
3838
39+
### Major specialties
40+
41+
To create a major release, a member of the repos with write permissions must write a comment with the content `aci=major`. awesome-ci then creates a major release.
3942

4043
### Requiered and optional environment variables
4144

service/getBuildInfos.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ func detectIfMajor(issueNumber int) bool {
142142
panic(err)
143143
}
144144
for _, comment := range issueComments {
145-
if strings.Contains(comment.Body, "aci=major") {
145+
// Must have permission in the repo to create a major version
146+
// MANNEQUIN|NONE https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
147+
if strings.Contains(comment.Body, "aci=major") && strings.Contains("MANNEQUIN|NONE", comment.AuthorAssociation) {
146148
resBool = true
147149
break
148150
}

0 commit comments

Comments
 (0)