From 8281f24c31ac4a0d2f465a6ec4a0cb978b25d130 Mon Sep 17 00:00:00 2001 From: Nick Gallegos Date: Wed, 23 Sep 2026 16:30:39 -0600 Subject: [PATCH 1/2] Add create-draft-release-with-assets composite action --- .../action.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/actions/create-draft-release-with-assets/action.yml diff --git a/.github/actions/create-draft-release-with-assets/action.yml b/.github/actions/create-draft-release-with-assets/action.yml new file mode 100644 index 0000000..87a67dc --- /dev/null +++ b/.github/actions/create-draft-release-with-assets/action.yml @@ -0,0 +1,19 @@ +name: Create draft release with assets +description: Creates a draft GitHub release and attaches asset files found under the given paths +inputs: + asset-paths: + required: true + description: Comma-separated paths/globs passed to Get-ChildItem, e.g. "nugets/, powershellModules/, assets/" +runs: + using: composite + steps: + - name: Create draft release and attach assets + shell: pwsh + run: | + $paths = '${{ inputs.asset-paths }}' -split ',' | ForEach-Object { $_.Trim() } + $assets = (Get-ChildItem -Path $paths -File -Recurse).FullName + Write-Output "Assets to attach: $assets" + Write-Output "Creating draft release for ${{ github.event.repository.name }} ${{ github.ref_name }} at commit ${{ github.sha }}" + gh release create ${{ github.ref_name }} $assets -d -n "" -t "${{ github.ref_name }}" + env: + GH_TOKEN: ${{ github.token }} From 32c6bef810b5c9a39a73a094bba583476badd313 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Wed, 7 Oct 2026 16:44:08 -0400 Subject: [PATCH 2/2] Make asset-paths optional --- .../actions/create-draft-release-with-assets/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/create-draft-release-with-assets/action.yml b/.github/actions/create-draft-release-with-assets/action.yml index 87a67dc..87c5e58 100644 --- a/.github/actions/create-draft-release-with-assets/action.yml +++ b/.github/actions/create-draft-release-with-assets/action.yml @@ -2,8 +2,9 @@ name: Create draft release with assets description: Creates a draft GitHub release and attaches asset files found under the given paths inputs: asset-paths: - required: true - description: Comma-separated paths/globs passed to Get-ChildItem, e.g. "nugets/, powershellModules/, assets/" + default: 'nugets,assets' + required: false + description: Comma-separated paths where asset files are located runs: using: composite steps: @@ -11,7 +12,7 @@ runs: shell: pwsh run: | $paths = '${{ inputs.asset-paths }}' -split ',' | ForEach-Object { $_.Trim() } - $assets = (Get-ChildItem -Path $paths -File -Recurse).FullName + $assets = (Get-ChildItem -LiteralPath ($paths.Where({Test-Path $_})) -File -Recurse).FullName Write-Output "Assets to attach: $assets" Write-Output "Creating draft release for ${{ github.event.repository.name }} ${{ github.ref_name }} at commit ${{ github.sha }}" gh release create ${{ github.ref_name }} $assets -d -n "" -t "${{ github.ref_name }}"