mirror of
https://github.com/softprops/action-gh-release.git
synced 2026-03-16 10:09:07 +08:00
fix: normalize refs-tag inputs (#755)
Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
alignAssetName,
|
||||
isTag,
|
||||
normalizeGlobPattern,
|
||||
normalizeTagName,
|
||||
parseConfig,
|
||||
parseInputFiles,
|
||||
paths,
|
||||
@@ -469,6 +470,10 @@ describe('util', () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('normalizes refs/tags-prefixed input_tag_name values', () => {
|
||||
expect(parseConfig({ INPUT_TAG_NAME: 'refs/tags/v1.2.3' }).input_tag_name).toBe('v1.2.3');
|
||||
});
|
||||
});
|
||||
describe('isTag', () => {
|
||||
it('returns true for tags', async () => {
|
||||
@@ -479,6 +484,16 @@ describe('util', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('normalizeTagName', () => {
|
||||
it('strips refs/tags/ from explicit tag names', () => {
|
||||
assert.equal(normalizeTagName('refs/tags/v1.2.3'), 'v1.2.3');
|
||||
});
|
||||
|
||||
it('leaves plain tag names unchanged', () => {
|
||||
assert.equal(normalizeTagName('v1.2.3'), 'v1.2.3');
|
||||
});
|
||||
});
|
||||
|
||||
describe('paths', () => {
|
||||
it('resolves files given a set of paths', async () => {
|
||||
assert.deepStrictEqual(paths(['tests/data/**/*', 'tests/data/does/not/exist/*']), [
|
||||
|
||||
Reference in New Issue
Block a user