Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Commit 1cb5a35

Browse files
committed
Update GitHub Actions
1 parent 49e53b2 commit 1cb5a35

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
PORT= # Port to be used by the app
21
GOOGLE_API_KEY= # Google Maps API KEY

.github/workflows/geocode.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- uses: actions/setup-node@v1
12-
- run: npm install
13-
- run: npm run geocode
12+
- run: npm install; npm run geocode
13+
env:
14+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
1415
- uses: stefanzweifel/git-auto-commit-action@v4
1516
with:
1617
commit_message: Geocoded newly added addresses

src/storage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const getNewLocations = () => {
1414
fs.promises.readFile(LOCATIONS_PATH),
1515
fs.promises.readFile(COORDINATES_PATH)
1616
]).then(([locations, coordinates]) => {
17-
const locationLength = String(locations).split("\n").length;
18-
const coordinateLength = String(coordinates).split("\n").length;
17+
const locationLength = String(locations).replace(/\n+$/,"").split("\n").length;
18+
const coordinateLength = String(coordinates).replace(/\n+$/,"").split("\n").length;
1919
console.log({locationLength, coordinateLength});
2020
return String(locations).split("\n").slice(coordinateLength);
2121
});

0 commit comments

Comments
 (0)