Update: Added debug input that displays contents of the downloaded archive.
All checks were successful
Test Action / test (push) Successful in 15s

This commit is contained in:
2026-01-11 01:08:38 +01:00
parent dd0b70853b
commit 95fbe95099
4 changed files with 40 additions and 28 deletions

View File

@@ -19,6 +19,7 @@ jobs:
uses: ./
with:
repo-name: 'rclone/rclone'
debug: 'true'
token: ${{ secrets.GH_TOKEN }}
- name: Verify Installation

View File

@@ -12,6 +12,10 @@ inputs:
description: 'The type of the file to be downloaded (archive, package, or custom regex).'
required: false
default: 'archive'
debug:
description: 'When set to true, displays the contents of the unpacked archive or directory.'
required: false
default: 'false'
token:
description: 'The GitHub token to use for authentication'
required: false

56
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -9,6 +9,7 @@ async function run() {
const repoName = core.getInput('repo-name', { required: true });
let fileName = core.getInput('file-name');
const fileType = core.getInput('file-type') || 'archive';
const debug = core.getBooleanInput('debug');
const token = core.getInput('token') || process.env.GITHUB_TOKEN;
// Detect system and architecture
@@ -155,6 +156,12 @@ async function run() {
// Handle nested directories in archives
if (/\.(zip|tar(\.gz)?|tgz|7z)$/i.test(nameLower)) {
const items = fs.readdirSync(toolDir);
if (debug) {
core.info(`Contents of ${toolDir}:`);
items.forEach(item => core.info(` - ${item}`));
}
if (items.length === 1 && fs.statSync(path.join(toolDir, items[0])).isDirectory()) {
core.info(`Detected single root directory in archive, descending into: ${items[0]}`);
toolDir = path.join(toolDir, items[0]);