New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

octoherd-script-validate-pr

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octoherd-script-validate-pr - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "octoherd-script-validate-pr",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",

@@ -5,0 +5,0 @@ "exports": "./script.js",

@@ -5,3 +5,3 @@ # octoherd-script-valid-pr

[![@latest](https://img.shields.io/npm/v/.svg)](https://www.npmjs.com/package/)
[![@latest](https://img.shields.io/npm/v/.svg)](https://www.npmjs.com/package/octoherd-script-validate-pr)
[![Build Status](https://github.com/bdougie/octoherd-script-valid-pr/workflows/Test/badge.svg)](https://github.com/bdougie/octoherd-script-valid-pr/actions?query=workflow%3ATest+branch%3Amain)

@@ -14,3 +14,3 @@

```js
npx;
npx octoherd-script-validate-pr;
```

@@ -21,5 +21,5 @@

```js
npx \
npx octoherd-script-good-pr \
-T ghp_0123456789abcdefghjklmnopqrstuvwxyzA \
-R "bdougie/*"
-R "open-sauced/*"
```

@@ -34,3 +34,6 @@

| `--octoherd-bypass-confirms` | boolean | Bypass prompts to confirm mutating requests |
| `--label` | string | Label to apply to issues/pull-requests (default: `needs info`) |
| `--text` | string | Forbidden text (default: `TODO`) to mark issues/pull-requests with label |
## Contributing

@@ -37,0 +40,0 @@

@@ -8,7 +8,10 @@ // @ts-check

* @param {import('@octoherd/cli').Repository} repository
* @param { {label?: string, text?: string} } options Custom user options passed to the CLI
*/
export async function script(octokit, repository) {
export async function script(octokit, repository, options) {
const [repoOwner, repoName] = repository.full_name.split("/");
const label = options.label || "needs info";
const forbiddenText = options.text || "TODO";
const issues = await octokit.request('GET /repos/{owner}/{repo}/issues', {
const issues = await octokit.paginate('GET /repos/{owner}/{repo}/issues', {
owner: repoOwner,

@@ -19,7 +22,6 @@ repo: repoName,

try {
for (let i = 0; i < issues.data.length; i++) {
const {body} = issues.data[0];
for (let i = 0; i < issues.length; i++) {
const {body} = issues[0];
// TODO: Pass this in as a argument
const todoExists = body.includes("TODO");
const todoExists = body.includes(forbiddenText);

@@ -31,4 +33,4 @@ if (todoExists) {

repo: repoName,
issue_number: issues.data[i].number,
labels: ["needs info"] // TODO: make this label an argument
issue_number: issues[i].number,
labels: [label]
})

@@ -35,0 +37,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc