-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (37 loc) · 1.21 KB
/
get-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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