Update: Renmaed input repo-name to repository.

This commit is contained in:
2026-01-11 07:37:07 +01:00
parent a6029b9169
commit 9b1f4f1f96
5 changed files with 14 additions and 14 deletions

View File

@@ -11,20 +11,20 @@ jobs:
- name: Go ACME Setup
uses: ./
with:
repo-name: 'go-acme/lego'
repository: 'go-acme/lego'
token: ${{ secrets.GH_TOKEN }}
- name: Setup Hugo
uses: ./
with:
repo-name: 'gohugoio/hugo'
repository: 'gohugoio/hugo'
file-name: '~hugo_extended_[^a-z]'
token: ${{ secrets.GH_TOKEN }}
- name: Setup RClone
uses: ./
with:
repo-name: 'rclone/rclone'
repository: 'rclone/rclone'
token: ${{ secrets.GH_TOKEN }}
- name: Verify Installation

View File

@@ -19,7 +19,7 @@ The action will automatically detect your OS (Linux, Windows, macOS) and archite
- name: Install Hugo
uses: koszewscy/setup-github-release@v1
with:
repo-name: 'go-acme/lego'
repository: 'go-acme/lego'
```
> **Note:** RClone is an example of a project that provides a binary in a subdirectory inside the archive. The action will find it automatically.
@@ -32,7 +32,7 @@ For projects with multiple binary versions, you can use a regex pattern (prefixe
- name: Install Extended Hugo
uses: koszewscy/setup-github-release@v1
with:
repo-name: 'gohugoio/hugo'
repository: 'gohugoio/hugo'
file-name: '~hugo_extended_[^a-z]' # Regex to match extended version
```
@@ -44,7 +44,7 @@ If the binary name is different from the repository name, like in the example of
- name: Install GitHub CLI
uses: koszewscy/setup-github-release@v1
with:
repo-name: 'cli/cli'
repository: 'cli/cli'
binary-name: 'gh' # Searches for 'gh' (or 'gh.exe') inside the extracted release
```
@@ -55,13 +55,13 @@ If you are unsure how the binary is named, use the `debug` flag to list all file
```yaml
- uses: koszewscy/setup-github-release@v1
with:
repo-name: 'owner/repo'
repository: 'owner/repo'
debug: true
```
## Inputs
- `repo-name` (required): GitHub repository in `owner/repo` format.
- `repository` (required): GitHub repository in `owner/repo` format.
- `file-name` (optional): Literal name or regex pattern (if starts with `~`) to match the asset.
- `binary-name` (optional): The name or regex pattern (if starts with `~`) of the binary to find. Defaults to the repository name.
- `file-type` (optional, default: `archive`): Predefined keywords `archive`, `package`, or a custom regex pattern.

View File

@@ -2,7 +2,7 @@ name: 'setup-github-release'
description: 'Install a tool from a GitHub release and add it to the PATH'
author: 'Slawomir Koszewski with GitHub Copilot assistance'
inputs:
repo-name:
repository:
description: 'The GitHub repository name (e.g., owner/repo)'
required: true
file-name:

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -36,7 +36,7 @@ function findBinary(dir: string, pattern: string | RegExp, debug: boolean): stri
async function run() {
try {
const repoName = core.getInput('repo-name', { required: true });
const repository = core.getInput('repository', { required: true });
let fileName = core.getInput('file-name');
const binaryInput = core.getInput('binary-name');
const fileType = core.getInput('file-type') || 'archive';
@@ -70,7 +70,7 @@ async function run() {
extPattern = fileType;
}
const url = `https://api.github.com/repos/${repoName}/releases/latest`;
const url = `https://api.github.com/repos/${repository}/releases/latest`;
const headers: Record<string, string> = {
'Accept': 'application/vnd.github.v3+json',
'User-Agent': 'setup-github-release-action'
@@ -79,7 +79,7 @@ async function run() {
headers['Authorization'] = `token ${token}`;
}
core.info(`Fetching latest release information for ${repoName}...`);
core.info(`Fetching latest release information for ${repository}...`);
const response = await fetch(url, { headers });
if (!response.ok) {
throw new Error(`Failed to fetch release: ${response.statusText} (${response.status})`);
@@ -141,7 +141,7 @@ async function run() {
}
const version = data.tag_name.replace(/^v/, '');
const toolName = repoName.split('/').pop() || repoName;
const toolName = repository.split('/').pop() || repository;
const binaryName = binaryInput || toolName;
// Check if the tool is already in the cache