Skip to content

Commit

Permalink
Ensure git is clean after builds to prevent state code being released
Browse files Browse the repository at this point in the history
adeira-source-id: 756426ee0ee0860312653f5a9c19dc0504b7d3c6
  • Loading branch information
itsdouges authored and triplex-bot committed Jan 24, 2025
1 parent 107ae04 commit 73bcb20
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/ensure-clean-git.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright (c) Michael Dougall. All rights reserved.
*
* This source code is licensed under the GPL-3.0 license found in the LICENSE
* file in the root directory of this source tree.
*/
const { spawnSync } = require("node:child_process");

Check failure on line 7 in scripts/ensure-clean-git.js

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

A `require()` style import is forbidden

const { output, status } = spawnSync("git diff --exit-code", {
shell: true,
});

if (status !== null && status !== 0) {
// eslint-disable-next-line no-console
console.error(
`
===== Unexpected Uncommitted Changes =====
${output.join("\n").trim()}
==========================================
`,
);
process.exit(1);
}

0 comments on commit 73bcb20

Please sign in to comment.