Skip to content

Commit 4cae7ae

Browse files
committed
fix: pass repository parameter to get-rust-library action
Composite actions don't have access to github.repository context. Pass it as an input parameter instead.
1 parent c492abf commit 4cae7ae

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/actions/get-rust-library/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ inputs:
55
github-token:
66
description: 'GitHub token for downloading releases'
77
required: true
8+
repository:
9+
description: 'GitHub repository (owner/repo)'
10+
required: true
811

912
runs:
1013
using: composite
@@ -15,7 +18,7 @@ runs:
1518
env:
1619
GITHUB_TOKEN: ${{ inputs.github-token }}
1720
run: |
18-
LATEST_RELEASE=$(gh release list --repo ${{ github.repository }} --limit 10 | grep -E "^rust-v" | head -1 | cut -f1)
21+
LATEST_RELEASE=$(gh release list --repo ${{ inputs.repository }} --limit 10 | grep -E "^rust-v" | head -1 | cut -f1)
1922
if [ -z "$LATEST_RELEASE" ]; then
2023
echo "No Rust release found, building locally"
2124
cargo build --release
@@ -40,7 +43,7 @@ runs:
4043
elif [ "$ARCH" = "x86_64" ]; then
4144
ARCH="x86_64"
4245
fi
43-
LATEST_RELEASE=$(gh release list --repo ${{ github.repository }} --limit 10 | grep -E "^rust-v" | head -1 | cut -f1)
46+
LATEST_RELEASE=$(gh release list --repo ${{ inputs.repository }} --limit 10 | grep -E "^rust-v" | head -1 | cut -f1)
4447
if [ -z "$LATEST_RELEASE" ]; then
4548
echo "No Rust release found, building locally"
4649
cargo build --release
@@ -59,7 +62,7 @@ runs:
5962
env:
6063
GITHUB_TOKEN: ${{ inputs.github-token }}
6164
run: |
62-
$latestRelease = gh release list --repo ${{ github.repository }} --limit 10 | Select-String -Pattern "^rust-v" | Select-Object -First 1
65+
$latestRelease = gh release list --repo ${{ inputs.repository }} --limit 10 | Select-String -Pattern "^rust-v" | Select-Object -First 1
6366
if ($latestRelease) {
6467
$releaseTag = ($latestRelease -split "`t")[0]
6568
Write-Host "Using Rust release: $releaseTag"

.github/workflows/go-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
uses: ./.github/actions/get-rust-library
5353
with:
5454
github-token: ${{ github.token }}
55+
repository: ${{ github.repository }}
5556

5657
- name: Run Go tests (Unix)
5758
if: matrix.os != 'windows-latest'
@@ -91,6 +92,7 @@ jobs:
9192
uses: ./.github/actions/get-rust-library
9293
with:
9394
github-token: ${{ github.token }}
95+
repository: ${{ github.repository }}
9496

9597
- name: Test download functionality
9698
run: |
@@ -123,6 +125,7 @@ jobs:
123125
uses: ./.github/actions/get-rust-library
124126
with:
125127
github-token: ${{ github.token }}
128+
repository: ${{ github.repository }}
126129

127130
- name: Run HuggingFace integration tests
128131
run: |

.github/workflows/go-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
uses: ./.github/actions/get-rust-library
4242
with:
4343
github-token: ${{ github.token }}
44+
repository: ${{ github.repository }}
4445

4546
- name: Run Go tests (Unix)
4647
if: matrix.os != 'windows-latest'

0 commit comments

Comments
 (0)