Skip to content

Commit 8d079fa

Browse files
Update permissions in publish workflow to allow GitHub releases
1 parent 3c4a8ea commit 8d079fa

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/publish-tagged-build.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- completed
99

1010
permissions:
11-
contents: read # Required for checkout/tag inspection
11+
contents: write # Required to create GitHub releases
1212
actions: read # Required to download artifacts from another workflow run
1313

1414
jobs:
@@ -18,6 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
HAS_RELEASE_TAG: 'false'
21+
RELEASE_TAG: ''
2122

2223
steps:
2324
- name: Checkout tagged commit
@@ -49,4 +50,16 @@ jobs:
4950
github-token: ${{ secrets.GITHUB_TOKEN }}
5051
artifact-output-path: nuget-packages
5152
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
53+
54+
- name: Create GitHub release
55+
if: env.HAS_RELEASE_TAG == 'true'
56+
uses: ncipollo/release-action@v1
57+
with:
58+
tag: ${{ env.RELEASE_TAG }}
59+
name: ${{ env.RELEASE_TAG }}
60+
generateReleaseNotes: true
61+
skipIfReleaseExists: true
62+
artifacts: nuget-packages/**/*.nupkg
63+
artifactErrorsFailBuild: false
64+
token: ${{ secrets.GITHUB_TOKEN }}
5265

0 commit comments

Comments
 (0)