diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml new file mode 100644 index 0000000..19db317 --- /dev/null +++ b/.github/workflows/base.yml @@ -0,0 +1,23 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Validate Project + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16.0 + uses: actions/setup-node@v3 + with: + node-version: 16.0 + cache: 'npm' + - run: npm ci + - run: npm run lint diff --git a/components/Header.js b/components/Header.js index b191bf3..7b33e03 100644 --- a/components/Header.js +++ b/components/Header.js @@ -37,13 +37,12 @@ function Header(props) { return { path, shortPath }; }); pathElement = formattedPaths.map( - path => , + (path) => , ); } else { pathElement = String(paths); } - return (

{githubRepo}

diff --git a/server.js b/server.js index 547192e..97787c2 100644 --- a/server.js +++ b/server.js @@ -2,7 +2,7 @@ const { createServer } = require('http'); const { parse } = require('url'); const next = require('next'); -const port = process.env.PORT || 3000 +const port = process.env.PORT || 3000; const dev = process.env.NODE_ENV !== 'production'; const app = next({ dev }); diff --git a/utilities/GithubAPI.js b/utilities/GithubAPI.js index 135af01..cfe1cb4 100644 --- a/utilities/GithubAPI.js +++ b/utilities/GithubAPI.js @@ -65,7 +65,7 @@ async function getDirectory(path) { if (!data || !Array.isArray(data) || !Object.prototype.hasOwnProperty.call(data[0], 'path')) { throw new Error('Failed to fetch tree.'); } - const pathArray = data.map(entry => entry.path); + const pathArray = data.map((entry) => entry.path); addCache(dirCache, path, pathArray); return pathArray; } catch (e) { @@ -88,7 +88,7 @@ async function getTree() { if (!data2.tree) { throw new Error('Unable to fetch tree'); } - const tree = data2.tree.map(branch => branch.path); + const tree = data2.tree.map((branch) => branch.path); addCache(treeCache, '/', tree); return tree; } catch (e) {