From 047888a63ed1a75cf6d1e5c6610b9a8ef4a39c2b Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 23 Aug 2023 14:53:31 +0200 Subject: [PATCH 1/2] Expects readme files in template-globs --- test/glob-patterns.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/glob-patterns.spec.ts b/test/glob-patterns.spec.ts index bfae728..83c18aa 100644 --- a/test/glob-patterns.spec.ts +++ b/test/glob-patterns.spec.ts @@ -19,7 +19,7 @@ describe('glob patterns tests', () => { const result = getIncludePatterns(args); - expect(result).toEqual(['action.{yml,yaml}', 'LICENSE']); + expect(result).toEqual(['action.{yml,yaml}', 'LICENSE', 'README{,.md}']); }); it('returns a javascript-action pattern when template is javascript-action', () => { @@ -27,7 +27,7 @@ describe('glob patterns tests', () => { const result = getIncludePatterns(args); - expect(result).toEqual(['action.{yml,yaml}', 'dist/**', 'LICENSE']); + expect(result).toEqual(['action.{yml,yaml}', 'dist/**', 'LICENSE', 'README{,.md}']); }); it('throws an error when an invalid template is specified', () => { @@ -74,6 +74,7 @@ describe('glob patterns tests', () => { 'action.{yml,yaml}', 'dist/**', 'LICENSE', + 'README{,.md}', 'README.md', '!src/*.ts', ]); From 2dec89442c09408e7d74e35587931d4c8b7e2099 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 23 Aug 2023 14:37:37 +0200 Subject: [PATCH 2/2] Adds readme to js-action's glob The readme should be included in the tag as well. Otherwise when selecting an older version in the marketplace there is no readme displayed. See also here: https://github.com/JasonEtco/build-and-tag-action/pull/18#issuecomment-1386746993 --- src/glob-patterns.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glob-patterns.ts b/src/glob-patterns.ts index c0618eb..d1465af 100644 --- a/src/glob-patterns.ts +++ b/src/glob-patterns.ts @@ -3,8 +3,8 @@ import fs from 'node:fs'; import type { Arguments } from './types'; const templates: Record = { - 'composite-action': ['action.{yml,yaml}', 'LICENSE'], - 'javascript-action': ['action.{yml,yaml}', 'dist/**', 'LICENSE'], + 'composite-action': ['action.{yml,yaml}', 'LICENSE', 'README{,.md}'], + 'javascript-action': ['action.{yml,yaml}', 'dist/**', 'LICENSE', 'README{,.md}'], }; const extractNames = (input: string) =>