Skip to content

Get Release

Get Release #27

Workflow file for this run

name: Get Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get Release Info
id: get-release-info
uses: actions/github-script@v5
with:
script: |
let uploadUrl = '';
try {
const release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
});
uploadUrl = release.data.upload_url;
} catch (error) {
console.log('Error fetching latest release: ', error.message);
uploadUrl = error.message;
}
return uploadUrl;
- name: Print release upload URL
run: echo "Upload URL is ${{ steps.get-release-info.outputs.result }}"
- name: Create dummy test.txt
run: echo "This is a test file" > ./test.txt
- name: Upload node Image to Release
uses: actions/upload-release-asset@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get-release-info.outputs.result }}
asset_path: ./test.txt
asset_name: test.txt
asset_content_type: application/octet-stream