mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
v2.4.0 - support local execution with act + allow tags (#40)
* Avoid code repetition with exec() and output listeners * Improve behavior for new branches and when it's running in ACT * Detect parent commit only if needed * Fix parent commit detection for initial commit * Improve logging * Improve current ref detection * Fix issue when base is a already fetched tag * Fix issue when base is a already fetched tag * Update README * Document usage with act * Use `git log` to get changes in latest commit * Disable other output for `git log` * get short name from base ref + improve loggig * update CHANGELOG
This commit is contained in:
parent
d9e86af7c0
commit
ff5bb057bf
7 changed files with 295 additions and 147 deletions
|
@ -17,19 +17,13 @@ describe('parsing output of the git diff command', () => {
|
|||
})
|
||||
|
||||
describe('git utility function tests (those not invoking git)', () => {
|
||||
test('Detects if ref references a tag', () => {
|
||||
expect(git.isTagRef('refs/tags/v1.0')).toBeTruthy()
|
||||
expect(git.isTagRef('refs/heads/master')).toBeFalsy()
|
||||
expect(git.isTagRef('master')).toBeFalsy()
|
||||
})
|
||||
test('Trims "refs/" from ref', () => {
|
||||
expect(git.trimRefs('refs/heads/master')).toBe('heads/master')
|
||||
expect(git.trimRefs('heads/master')).toBe('heads/master')
|
||||
expect(git.trimRefs('master')).toBe('master')
|
||||
})
|
||||
test('Trims "refs/" and "heads/" from ref', () => {
|
||||
expect(git.trimRefsHeads('refs/heads/master')).toBe('master')
|
||||
expect(git.trimRefsHeads('heads/master')).toBe('master')
|
||||
expect(git.trimRefsHeads('master')).toBe('master')
|
||||
expect(git.getShortName('refs/heads/master')).toBe('master')
|
||||
expect(git.getShortName('heads/master')).toBe('heads/master')
|
||||
expect(git.getShortName('master')).toBe('master')
|
||||
|
||||
expect(git.getShortName('refs/tags/v1')).toBe('v1')
|
||||
expect(git.getShortName('tags/v1')).toBe('tags/v1')
|
||||
expect(git.getShortName('v1')).toBe('v1')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue