diff --git a/CHANGELOG.md b/CHANGELOG.md index bb72547..3bf0e61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ All notable changes to this GitHub action will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [0.5.1] - 2023-07-05 +### Fixed +- Check issues with authenticated user. [#66](https://github.com/zaproxy/action-full-scan/issues/66) ## [0.5.0] - 2023-06-29 @@ -40,7 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). First release to Marketplace. -[Unreleased]: https://github.com/zaproxy/action-api-scan/compare/v0.5.0...HEAD +[0.5.1]: https://github.com/zaproxy/action-full-scan/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/zaproxy/action-full-scan/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/zaproxy/action-full-scan/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/zaproxy/action-full-scan/compare/v0.2.0...v0.3.0 diff --git a/README.md b/README.md index 315228a..4e1b533 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ if it identifies any alerts. Set this option to `true` if you want to fail the s ``` steps: - name: ZAP Scan - uses: zaproxy/action-full-scan@v0.5.0 + uses: zaproxy/action-full-scan@v0.5.1 with: target: 'https://www.zaproxy.org/' ``` @@ -84,7 +84,7 @@ jobs: with: ref: master - name: ZAP Scan - uses: zaproxy/action-full-scan@v0.5.0 + uses: zaproxy/action-full-scan@v0.5.1 with: token: ${{ secrets.GITHUB_TOKEN }} docker_name: 'owasp/zap2docker-stable' diff --git a/dist/index.js b/dist/index.js index 90a1d83..59b5b52 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8081,11 +8081,17 @@ const actionCommon = { create_new_issue = true; } else { + let login = "github-actions[bot]"; + try { + login = (await octokit.users.getAuthenticated()).data.login; + } + catch (e) { + console.log(`Using ${login} to serch for issues.`); + } // Sometimes search API returns recently closed issue as an open issue for (let i = 0; i < issues.data.items.length; i++) { const issue = issues.data.items[i]; - if (issue["state"] === "open" && - issue["user"]["login"] === "github-actions[bot]") { + if (issue["state"] === "open" && issue["user"]["login"] === login) { openIssue = issue; break; } @@ -8108,7 +8114,7 @@ const actionCommon = { let lastBotComment; const lastCommentIndex = comments["data"].length - 1; for (let i = lastCommentIndex; i >= 0; i--) { - if (comments["data"][i]["user"]["login"] === "github-actions[bot]") { + if (comments["data"][i]["user"]["login"] === login) { lastBotComment = comments["data"][i]; break; } diff --git a/package-lock.json b/package-lock.json index 7bcc9f5..b26add5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", - "@zaproxy/actions-common-scans": "^1.0.0", + "@zaproxy/actions-common-scans": "^1.0.2", "lodash": "^4.17.21" }, "devDependencies": { @@ -180,9 +180,9 @@ } }, "node_modules/@zaproxy/actions-common-scans": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zaproxy/actions-common-scans/-/actions-common-scans-1.0.0.tgz", - "integrity": "sha512-/QvbxpI6nvmSGta/fRV9WIJ6mdojh6bsa2Nmgkm/v6hzdTKNkcfvmL5Zh/Kp4o444SUZJF3HBpOVdDHDfwWMDA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@zaproxy/actions-common-scans/-/actions-common-scans-1.0.2.tgz", + "integrity": "sha512-MfhVLSdsSN85B4nZkRC7yUq2BGN7DCjE/jT2LV2x8nFbfUswopptXyb+puX59C0vtP0cvil75mLiTlNCACg9kQ==", "dependencies": { "@actions/artifact": "^1.1.0", "@actions/github": "^5.1.1", @@ -564,9 +564,9 @@ "dev": true }, "@zaproxy/actions-common-scans": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zaproxy/actions-common-scans/-/actions-common-scans-1.0.0.tgz", - "integrity": "sha512-/QvbxpI6nvmSGta/fRV9WIJ6mdojh6bsa2Nmgkm/v6hzdTKNkcfvmL5Zh/Kp4o444SUZJF3HBpOVdDHDfwWMDA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@zaproxy/actions-common-scans/-/actions-common-scans-1.0.2.tgz", + "integrity": "sha512-MfhVLSdsSN85B4nZkRC7yUq2BGN7DCjE/jT2LV2x8nFbfUswopptXyb+puX59C0vtP0cvil75mLiTlNCACg9kQ==", "requires": { "@actions/artifact": "^1.1.0", "@actions/github": "^5.1.1", diff --git a/package.json b/package.json index 1718505..615c8c1 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", - "@zaproxy/actions-common-scans": "^1.0.0", + "@zaproxy/actions-common-scans": "^1.0.2", "lodash": "^4.17.21" }, "devDependencies": {