diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index aa9f4e846..71aec0982 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -7,6 +7,11 @@ on: - 'beta/v**' - 'release/v**' - 'test/v**' + workflow_dispatch: + inputs: + tag: + description: 'Tag to build from' + required: true jobs: build: @@ -26,7 +31,8 @@ jobs: github-token: ${{ secrets.RELEASE_NOTES_TOKEN }} result-encoding: string script: | - return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[1]; + const ref = process.env.GITHUB_REF || github.event.inputs.tag || ''; + return ref.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[1]; - name: Get file version from tag id: get_version uses: actions/github-script@v7 @@ -34,7 +40,8 @@ jobs: github-token: ${{ secrets.RELEASE_NOTES_TOKEN }} result-encoding: string script: | - return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[4]; + const ref = process.env.GITHUB_REF || github.event.inputs.tag || ''; + return ref.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[4]; - name: Get main mc version from tag id: get_mc_version uses: actions/github-script@v7 @@ -42,7 +49,8 @@ jobs: github-token: ${{ secrets.RELEASE_NOTES_TOKEN }} result-encoding: string script: | - return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[3]; + const ref = process.env.GITHUB_REF || github.event.inputs.tag || ''; + return ref.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[3]; - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 with: