Skip to content

Commit 809187b

Browse files
authored
fixed workflow
1 parent 5be93ae commit 809187b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/dotnet.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ jobs:
5252
- name: Github release
5353
shell: bash
5454
env:
55-
GITHUB_TOKEN: ${{ github.TOKEN }}
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5656
if: env.GITHUB_TOKEN != ''
5757
run: |
58-
gh release create ${{env.CURRENT_VERSION}} ./GithubActionsHelloWorld/bin/Release/*.*nupkg --generate-notes
58+
set -e
59+
gh release create ${{env.CURRENT_VERSION}} ./GithubActionsHelloWorld/bin/Release/*.*nupkg --generate-notes || {
60+
echo "Failed to create GitHub release"
61+
exit 1
62+
}
5963
deployTest:
6064
if: github.ref != 'refs/heads/main'
6165
runs-on: ubuntu-latest
@@ -80,8 +84,11 @@ jobs:
8084
- name: Github release
8185
shell: bash
8286
env:
83-
GITHUB_TOKEN: ${{ github.TOKEN }}
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8488
if: env.GITHUB_TOKEN != ''
8589
run: |
86-
gh release create ${{env.CURRENT_VERSION}} ./GithubActionsHelloWorld/bin/Release/*.*nupkg --prerelease --generate-notes
87-
90+
set -e
91+
gh release create ${{env.CURRENT_VERSION}} ./GithubActionsHelloWorld/bin/Release/*.*nupkg --prerelease --generate-notes || {
92+
echo "Failed to create GitHub release"
93+
exit 1
94+
}

0 commit comments

Comments
 (0)