Skip to content

Commit 5168ee2

Browse files
committed
Improve comment blocks in version.yml
Removed the unnecessary "optional" commented code blocks from version.yml, and replaced them with a small explainer annotation at the top.
1 parent 513440f commit 5168ee2

File tree

1 file changed

+15
-35
lines changed

1 file changed

+15
-35
lines changed

.github/workflows/version.yml

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Create and push the commit and tag created from npm version <version>
2+
#
3+
# From the Actions page on GitHub, users (with write permissions) can select
4+
# the desired release <version> and this action will handle running npm version
5+
# and pushing the tag to the repository.
6+
#
7+
# Due to the VERSION_TOKEN, the tag push will trigger release.yml, which handles
8+
# releasing to npm and GitHub releases.
9+
#
10+
# With pre* versions (prerelease, prepatch, etc.), the tag will be created with
11+
# --preid beta. Currently, they are released normally, to --tag latest on npm.
12+
113
name: Push new version
214

315
on:
@@ -16,41 +28,12 @@ on:
1628
- prepatch
1729
- preminor
1830
- premajor
19-
# Uncomment the following for text input preId
20-
# preId:
21-
# description: 'Prerelease identifier (required with pre*)'
22-
# required: false
23-
# type: string
24-
# Uncomment the following for selection preId
25-
# preId:
26-
# description: 'Prerelease identifier (used with pre*)'
27-
# required: true
28-
# default: 'beta'
29-
# type: choice
30-
# options:
31-
# - alpha
32-
# - beta
3331

3432
jobs:
35-
# Uncomment the following step if using text input preId
36-
# validate:
37-
# name: Validate workflow inputs
38-
# runs-on: ubuntu-latest
39-
40-
# steps:
41-
# - name: Invalid prerelease identifier
42-
# if: ${{ startsWith(github.event.inputs.version, 'pre') && !github.event.inputs.preId }}
43-
# run: |
44-
# echo "Error: 'preId' input is required with 'pre-*' version."
45-
# exit 1
46-
4733
version:
4834
name: Push ${{ inputs.version }} tag
4935
runs-on: ubuntu-latest
5036

51-
# Uncomment the following line if using the validate step above
52-
# needs: [validate]
53-
5437
steps:
5538
- name: Checkout branch
5639
uses: actions/checkout@v4
@@ -67,10 +50,7 @@ jobs:
6750
run: |
6851
git config --global user.name "${{ github.actor }}"
6952
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
70-
- name: NPM version
71-
# Uncomment the following line if using preId input
72-
# run: echo "version=$(npm version ${{ inputs.version }}${{ startsWith(inputs.version, 'pre') && format(' --preid {0}', inputs.preId) || '' }})" >> "$GITHUB_ENV"
73-
# Uncomment the following line for hardcoded 'beta' preId
74-
run: echo "version=$(npm version ${{ inputs.version }})${{ startsWith(inputs.version, 'pre') && '--preid beta' || ''}}" >> "$GITHUB_ENV"
75-
- name: Git push
53+
- name: npm version ${{ inputs.version }}
54+
run: echo "version=$(npm version ${{ inputs.version }}${{ startsWith(inputs.version, 'pre') && '--preid beta' || '' }})" >> "$GITHUB_ENV"
55+
- name: git push
7656
run: git push && git push origin ${{ env.version }}

0 commit comments

Comments
 (0)