Skip to content

Commit cb42682

Browse files
committed
Switch to manual workflow run
1 parent 1ebc7e5 commit cb42682

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: Publish
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
# require SHA as tags and branches are mutable
8+
description: Git commit SHA (not branch/tag)
9+
required: true
10+
type: string
611

712
env:
813
FORCE_COLOR: 1
@@ -12,8 +17,24 @@ jobs:
1217
runs-on: ubuntu-latest
1318

1419
steps:
20+
- name: Log inputs
21+
run: echo "${{ inputs }}"
22+
1523
- name: Checkout repository
1624
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
with:
26+
ref: ${{ inputs.ref }}
27+
fetch-depth: 2 # shouldn't need much, if any, history
28+
29+
- name: Log Git tag
30+
run: git describe --always --tags
31+
32+
- name: Check ref is the commit SHA
33+
# require SHA as tags and branches are mutable
34+
run: test "${{ inputs.ref }}"
35+
= "$(git git log --max-count=1 --format=format:%h)"
36+
|| test "${{ inputs.ref }}"
37+
= "$(git git log --max-count=1 --format=format:%H)"
1738

1839
# pipx is pre-installed in 'ubuntu' VMs
1940

0 commit comments

Comments
 (0)