Skip to content

Commit

Permalink
correctly set output
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanphan committed Sep 13, 2024
1 parent 83e8d67 commit aee77d4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/deploy-program.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ jobs:
if: needs.check_tag.outputs.type == 'release'
with:
script: |
const core = require('@actions/core');
const tag = "${{ inputs.git_ref }}";
const assetName = "${{ env.PROGRAM_NAME }}.so";
Expand All @@ -177,18 +178,12 @@ jobs:
throw new Error(`Failed to fetch release for tag ${tag}`);
}
// Find the specific asset by name
const asset = release.data.assets.find(asset => asset.name === assetName);
if (!asset) {
throw new Error(`Asset ${assetName} not found in release tagged ${tag}`);
}
console.log(asset);
return {
download_url: asset.url,
asset_name: asset.name
};
core.setOutput("url", asset.url);
- name: Download the Selected Asset
if: needs.check_tag.outputs.type == 'release'
Expand All @@ -197,7 +192,7 @@ jobs:
curl -L -o ${{ github.workspace }}/programs/.bin/${{ env.PROGRAM_NAME }}.so \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/octet-stream" \
"${{ steps.get_release.outputs.download_url }}"
"${{ steps.get_release.outputs.url }}"
- name: Deploy Program
if: github.event.inputs.dry_run == 'false'
Expand Down

0 comments on commit aee77d4

Please sign in to comment.