Skip to content

Commit f669036

Browse files
committed
Update release Webhook
1 parent 7848fb3 commit f669036

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Release to CurseForge and Modrinth
22

33
on:
4-
release:
5-
types: [created, published]
4+
# Only trigger manually to avoid duplicate runs
5+
# GitHub CLI releases don't reliably trigger workflows anyway
66
workflow_dispatch:
77
inputs:
88
release_tag:
99
description: 'Release tag to process (e.g., v1.20.4)'
10-
required: false
10+
required: true
1111
type: string
1212

1313
jobs:
@@ -17,8 +17,8 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v3
1919
with:
20-
# If workflow_dispatch, checkout the tag
21-
ref: ${{ github.event.inputs.release_tag || github.ref }}
20+
# Checkout the specified tag
21+
ref: ${{ github.event.inputs.release_tag }}
2222

2323
- name: Set up JDK 17
2424
uses: actions/setup-java@v3
@@ -33,12 +33,8 @@ jobs:
3333
- name: Get artifact info
3434
id: artifact
3535
run: |
36-
# For workflow_dispatch, use the input tag, otherwise use the ref name
37-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38-
VERSION="${{ github.event.inputs.release_tag }}"
39-
else
40-
VERSION="${GITHUB_REF_NAME}"
41-
fi
36+
# Use the input tag
37+
VERSION="${{ github.event.inputs.release_tag }}"
4238
VERSION="${VERSION#v}" # Remove 'v' prefix if present
4339
echo "jar_path=$(find target/ -name 'MinecraftServerAPI-*.jar' | head -n 1)" >> $GITHUB_OUTPUT
4440
echo "version=${VERSION}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)