Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/vectorguard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Security PR Review
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
review:
permissions:
contents: read
pull-requests: write
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monizb/vectorguard-pr-scanner@main # Replace with your tag/version
with:
model: gemini-flash-latest
temperature: 0.2
enable_inline: false
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// Random utility function
export function getRandomInt(max) {
return Math.floor(Math.random() * max);
}

// New feature: Display random number on the app
import React, { useState } from 'react';

function RandomNumberFeature() {
const [number, setNumber] = useState(0);
return (
<div style={{margin: '20px', padding: '10px', border: '1px solid #ccc'}}>
<h3>Random Number Feature</h3>
<p>Number: {number}</p>
<button onClick={() => setNumber(getRandomInt(100))}>Generate Random Number</button>
</div>
);
}
import React from "react";

import { Route, Switch } from "react-router-dom";
Expand Down Expand Up @@ -33,6 +51,7 @@ function App(props) {
<Route path="/signup" component={SignUp} />
<Route path="/forgot-password" component={ForgotPassword} />
<Route path="/" component={Home} />
<RandomNumberFeature />
</Switch>
);
}
Expand Down
6 changes: 6 additions & 0 deletions src/selectors/selectors.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// New selector utility: selectRandomUrl
export const selectRandomUrl = (state) => {
const urls = state.links && state.links.items ? state.links.items : [];
if (urls.length === 0) return null;
return urls[Math.floor(Math.random() * urls.length)];
};
export const getFilteredLinks = (links, { text }) => {
return links.filter((link) => {
const textMatch =
Expand Down