Skip to content

A local-first personal finance app

☁️ Server workflows run only when server files have changed (#4348)

Michael Clarkbe2126e136d5
diff --git a/.github/workflows/docker-edge.yml b/.github/workflows/docker-edge.yml
index 11f141879e..ef3b59aa61 100644
--- a/.github/workflows/docker-edge.yml
+++ b/.github/workflows/docker-edge.yml
@@ -5,12 +5,13 @@ on:
push:
branches:
- master
- paths-ignore:
- - README.md
- - LICENSE.txt
+ paths:
+ - packages/sync-server
pull_request:
branches:
- master
+ paths:
+ - packages/sync-server
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 9c5127795d..1dab635e28 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -1,6 +1,10 @@
name: E2E Tests
-on: [pull_request]
+on:
+ pull_request:
+ paths-ignore:
+ - packages/sync-server
+ - upcoming-release-notes
env:
GITHUB_PR_NUMBER: ${{github.event.pull_request.number}}
diff --git a/.github/workflows/size-compare.yml b/.github/workflows/size-compare.yml
index 008f98a764..d41a228192 100644
--- a/.github/workflows/size-compare.yml
+++ b/.github/workflows/size-compare.yml
@@ -13,6 +13,9 @@ name: Compare Sizes
on:
pull_request_target:
+ paths-ignore:
+ - packages/sync-server
+ - upcoming-release-notes
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
diff --git a/packages/sync-server/src/app-simplefin/app-simplefin.js b/packages/sync-server/src/app-simplefin/app-simplefin.js
index e401824f2f..f453f0b150 100644
--- a/packages/sync-server/src/app-simplefin/app-simplefin.js
+++ b/packages/sync-server/src/app-simplefin/app-simplefin.js
@@ -76,13 +76,13 @@ app.post(
}
if (Array.isArray(accountId) != Array.isArray(startDate)) {
- console.log(accountId, startDate);
+ console.log({ accountId, startDate });
throw new Error(
'accountId and startDate must either both be arrays or both be strings',
);
}
if (Array.isArray(accountId) && accountId.length !== startDate.length) {
- console.log(accountId, startDate);
+ console.log({ accountId, startDate });
throw new Error('accountId and startDate arrays must be the same length');
}
diff --git a/packages/sync-server/src/util/middlewares.js b/packages/sync-server/src/util/middlewares.js
index 99eb821280..69b0e5eaf0 100644
--- a/packages/sync-server/src/util/middlewares.js
+++ b/packages/sync-server/src/util/middlewares.js
@@ -22,7 +22,11 @@ async function errorMiddleware(err, req, res, next) {
// Source: https://expressjs.com/en/guide/error-handling.html
return next(err);
}
- console.log(`Error on endpoint ${req.url}`, err.message, err.stack);
+
+ console.log(`Error on endpoint %s`, {
+ requestUrl: req.url,
+ stacktrace: err.stack,
+ });
res.status(500).send({ status: 'error', reason: 'internal-error' });
}
diff --git a/upcoming-release-notes/4348.md b/upcoming-release-notes/4348.md
new file mode 100644
index 0000000000..5b0ace66b5
--- /dev/null
+++ b/upcoming-release-notes/4348.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MikesGlitch]
+---
+
+Making Server related github actions run only when server files change