Skip to content

Commit a2af391

Browse files
committed
Fix oversights in publish workflow
1 parent 8330880 commit a2af391

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ on:
77
tags:
88
- v** # Only when a v... tag is pushed
99

10-
# Sets permissions of the GITHUB_TOKEN to allow reading packages and push releases
10+
# Sets permissions of the GITHUB_TOKEN to allow writing packages and push releases
1111
permissions:
12-
packages: read
12+
packages: write
1313

1414
env:
1515
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
1616
DOTNET_NOLOGO: true
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1718
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1819
NuGetDirectory: ${{ github.workspace}}/nuget
1920

@@ -30,6 +31,9 @@ jobs:
3031
runs-on: ubuntu-latest
3132
needs: [ build ]
3233
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
3337
- name: Download NuGet Packages Artifact
3438
uses: actions/download-artifact@v4
3539
with:
@@ -39,8 +43,6 @@ jobs:
3943
- name: Build Changelog
4044
id: build_changelog
4145
uses: mikepenz/release-changelog-builder-action@v4
42-
#env:
43-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4446

4547
- name: Create Release
4648
uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release
@@ -73,5 +75,5 @@ jobs:
7375
- name: Publish NuGet Packages
7476
run: |
7577
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
76-
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://nuget.pkg.github.com/MonkeyModdingTroop/index.json --skip-duplicate
78+
dotnet nuget push $file --api-key "${{ secrets.GITHUB_TOKEN }}" --source https://nuget.pkg.github.com/MonkeyModdingTroop/index.json --skip-duplicate
7779
}

0 commit comments

Comments
 (0)