Skip to content

Commit

Permalink
Update get-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha authored Jan 4, 2024
1 parent 9ebcb08 commit 0b88e12
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/get-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ jobs:
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;
let uploadUrl = '';
try {
const release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
});
uploadUrl = release.data.upload_url.replace(/\{\?name,label\}/, '');
} catch (error) {
console.log('Error fetching latest release: ', 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
Expand Down

0 comments on commit 0b88e12

Please sign in to comment.