Skip to content

Commit c4ed883

Browse files
authored
fix: added more valuables to default ignore keys (#351)
* fix: added more valuables to default ignore keys * chore: changeset
1 parent 5969a30 commit c4ed883

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

.changeset/common-ways-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'dotenv-diff': patch
3+
---
4+
5+
added CI, GITHUB_ACTIONS and INIT_CWD to default ignore keys

docs/configuration_and_flags.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ Specify a comma-separated list of keys to ignore during the comparison other tha
158158
- `PROD`
159159
- `DEV`
160160
- `SSR`
161+
- `CI`
162+
- `GITHUB_ACTIONS`
163+
- `INIT_CWD`
161164

162165
This is useful when you have certain environment variables that are expected to differ between environments and you want to exclude them from the comparison.
163166

packages/cli/src/core/filterIgnoredKeys.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export const DEFAULT_EXCLUDE_KEYS = [
1111
'PROD',
1212
'DEV',
1313
'SSR',
14+
'CI',
15+
'GITHUB_ACTIONS',
16+
'INIT_CWD',
1417
];
1518

1619
/**

packages/cli/test/unit/core/filterIgnoredKeys.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ describe('filterIgnoredKeys', () => {
5757
expect(res).not.toContain('MODE');
5858
expect(res).not.toContain('PWD');
5959
});
60+
61+
it('Will ignore CI and GITHUB_ACTIONS by default', () => {
62+
const keys = ['CI', 'GITHUB_ACTIONS', 'API_KEY'];
63+
const res = filterIgnoredKeys(keys, [], []);
64+
expect(res).toEqual(['API_KEY']);
65+
});
6066
});

0 commit comments

Comments
 (0)