Skip to content

Commit 7e370a0

Browse files
EliotJonesBobLd
authored andcommitted
confirm tag is on master before running publish
1 parent b9aa531 commit 7e370a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/publish_nuget.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
- name: Verify tag points to master
19+
id: verify
20+
run: |
21+
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref_name }})
22+
if ! git branch -r --contains $TAG_COMMIT | grep -q 'origin/master'; then
23+
echo "Tag is not on master — skipping publish"
24+
exit 78 # 78 = neutral in GitHub Actions
25+
fi
1826
1927
- name: Set up .NET
2028
uses: actions/setup-dotnet@v4

0 commit comments

Comments
 (0)