Skip to content

Commit d7eab41

Browse files
authored
Merge pull request #20 from thc202/release-v0.3.1
Update dependency and release v0.3.1
2 parents 4489cbf + 77ecdb1 commit d7eab41

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ All notable changes to this GitHub action will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [Unreleased]
7+
## [0.3.1] - 2023-07-05
8+
### Fixed
9+
- Check issues with authenticated user. [#19](https://github.com/zaproxy/action-api-scan/issues/19)
810

911
## [0.3.0] - 2023-06-29
1012

@@ -26,7 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2628

2729
First release to Marketplace.
2830

29-
[Unreleased]: https://github.com/zaproxy/action-api-scan/compare/v0.3.0...HEAD
31+
[0.3.1]: https://github.com/zaproxy/action-api-scan/compare/v0.3.0...v0.3.1
3032
[0.3.0]: https://github.com/zaproxy/action-api-scan/compare/v0.2.0...v0.3.0
3133
[0.2.0]: https://github.com/zaproxy/action-api-scan/compare/v0.1.1...v0.2.0
3234
[0.1.1]: https://github.com/zaproxy/action-api-scan/compare/v0.1.0...v0.1.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ will be copied into the docker container:
7373
```
7474
steps:
7575
- name: ZAP Scan
76-
uses: zaproxy/action-api-scan@v0.3.0
76+
uses: zaproxy/action-api-scan@v0.3.1
7777
with:
7878
target: 'https://www.zaproxy.org/'
7979
```
@@ -94,7 +94,7 @@ jobs:
9494
ref: master
9595
9696
- name: ZAP Scan
97-
uses: zaproxy/action-api-scan@v0.3.0
97+
uses: zaproxy/action-api-scan@v0.3.1
9898
with:
9999
token: ${{ secrets.GITHUB_TOKEN }}
100100
docker_name: 'owasp/zap2docker-stable'

dist/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8081,11 +8081,17 @@ const actionCommon = {
80818081
create_new_issue = true;
80828082
}
80838083
else {
8084+
let login = "github-actions[bot]";
8085+
try {
8086+
login = (await octokit.users.getAuthenticated()).data.login;
8087+
}
8088+
catch (e) {
8089+
console.log(`Using ${login} to serch for issues.`);
8090+
}
80848091
// Sometimes search API returns recently closed issue as an open issue
80858092
for (let i = 0; i < issues.data.items.length; i++) {
80868093
const issue = issues.data.items[i];
8087-
if (issue["state"] === "open" &&
8088-
issue["user"]["login"] === "github-actions[bot]") {
8094+
if (issue["state"] === "open" && issue["user"]["login"] === login) {
80898095
openIssue = issue;
80908096
break;
80918097
}
@@ -8108,7 +8114,7 @@ const actionCommon = {
81088114
let lastBotComment;
81098115
const lastCommentIndex = comments["data"].length - 1;
81108116
for (let i = lastCommentIndex; i >= 0; i--) {
8111-
if (comments["data"][i]["user"]["login"] === "github-actions[bot]") {
8117+
if (comments["data"][i]["user"]["login"] === login) {
81128118
lastBotComment = comments["data"][i];
81138119
break;
81148120
}

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dependencies": {
2424
"@actions/core": "^1.10.0",
2525
"@actions/exec": "^1.1.1",
26-
"@zaproxy/actions-common-scans": "^1.0.0",
26+
"@zaproxy/actions-common-scans": "^1.0.2",
2727
"lodash": "^4.17.21"
2828
},
2929
"devDependencies": {

0 commit comments

Comments
 (0)