Skip to content

Commit

Permalink
Use glob to support wildcards
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisHsu committed Mar 20, 2024
1 parent 7a88f01 commit 65cc74e
Show file tree
Hide file tree
Showing 4 changed files with 39,387 additions and 6 deletions.
38,949 changes: 38,946 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Core = require('@actions/core');
const Github = require('@actions/github');
const Path = require("path")
const fs = require('fs')
const {globSync} = require('glob')

try {
// Get octokit
Expand All @@ -13,7 +14,8 @@ try {
const [name_str, release_name] = note_content.match(/^#\s+(.*)\n/);
note_content = note_content.substring(name_str.length);
// Get assets
const asset_paths = Core.getInput('assets').length ? Core.getInput('assets').split("\n").map(s => s.trim()) : [];
const asset_paths = Core.getInput('assets').length ? Core.getInput('assets').split("\n").reduce((prev, cur) => prev.concat(globSync(cur.trim())), []) : [];

// Create release
Octokit.rest.repos.createRelease({
owner: Github.context.repo.owner,
Expand Down
Loading

0 comments on commit 65cc74e

Please sign in to comment.