feat: respect working_directory for files globs; add input and tests (#667)

This commit is contained in:
Stephen Way 2025-10-06 19:51:45 -07:00 committed by GitHub
parent 14820f2cee
commit 4db716b167
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 50 additions and 8 deletions

View file

@ -128,6 +128,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -156,6 +157,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -183,6 +185,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -211,6 +214,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -243,6 +247,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: 'env-token',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -272,6 +277,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: 'input-token',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -300,6 +306,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -327,6 +334,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: false,
input_body: undefined,
input_body_path: undefined,
@ -354,6 +362,7 @@ describe('util', () => {
github_ref: '',
github_repository: '',
github_token: '',
input_working_directory: undefined,
input_append_body: true,
input_body: undefined,
input_body_path: undefined,
@ -388,6 +397,10 @@ describe('util', () => {
'tests/data/foo/bar.txt',
]);
});
it('resolves files relative to working_directory', async () => {
assert.deepStrictEqual(paths(['data/**/*'], 'tests'), ['tests/data/foo/bar.txt']);
});
});
describe('unmatchedPatterns', () => {
@ -397,6 +410,12 @@ describe('util', () => {
['tests/data/does/not/exist/*'],
);
});
it('resolves unmatched relative to working_directory', async () => {
assert.deepStrictEqual(unmatchedPatterns(['data/does/not/exist/*'], 'tests'), [
'data/does/not/exist/*',
]);
});
});
describe('replaceSpacesWithDots', () => {