You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# git-version-lite
2
2
3
-
This template can be used to calculate a release or pre-release version.
3
+
This template can be used to calculate a release or pre-release version.
4
4
5
5
## Index <!-- omit in toc -->
6
6
@@ -28,7 +28,7 @@ This action relies on git history in order to determine the next version. This
28
28
29
29
## Release vs Pre-release
30
30
31
-
You can control whether the action will generate a release or pre-release next version with the `calculate-prerelease-version` flag. The pre-release versions are intended for use with branches and a branch name is required to generate one.
31
+
You can control whether the action will generate a release or pre-release next version with the `calculate-prerelease-version` flag. The pre-release versions are intended for use with branches and a branch name is required to generate one.
32
32
33
33
- Release version format: `major.minor.patch` (`1.0.0`)
34
34
- Pre-release version format: `major.minor.patch-<cleaned-branch-name>.<formated-date>` (`0.1.0-my-branch.210907164247`)
@@ -92,15 +92,15 @@ Each of the outputs are available as environment variables and as action outputs
92
92
- The `github-token` input was removed
93
93
- This was only needed to create a ref on the repository so it is no longer needed.
94
94
- The `NEXT_VERSION_SHA` output was removed
95
-
- Workflows can use the value that git-version-lite outputted directly.
96
-
- For `pull_request` workflow triggers the value was `github.event.pull_request.head.sha`.
95
+
- Workflows can use the value that git-version-lite outputted directly.
96
+
- For `pull_request` workflow triggers the value was `github.event.pull_request.head.sha`.
97
97
- For all other workflow triggers the value was `github.sha`
98
98
99
99
## Usage Examples
100
100
101
101
```yml
102
102
on:
103
-
pull_request:
103
+
pull_request:
104
104
105
105
jobs:
106
106
get-prerelease-version:
@@ -116,14 +116,14 @@ jobs:
116
116
117
117
- id: get-version
118
118
# You may also reference just the major version.
119
-
uses: im-open/git-version-lite@v3.0.0
119
+
uses: im-open/git-version-lite@v3.1.0
120
120
with:
121
121
calculate-prerelease-version: true
122
122
branch-name: ${{ github.head_ref }} # github.head_ref works when the trigger is pull_request
123
123
tag-prefix: v # Prepend a v to any calculated release/pre-release version
124
124
fallback-to-no-prefix-search: true # Set to true can be helpful when starting to add tag prefixes
125
125
default-release-type: major # If no tags are found, default to doing a major increment
126
-
126
+
127
127
- run: |
128
128
echo "The next version is ${{ env.NEXT_VERSION }}"
129
129
echo "The next version without the prefix is ${{ steps.get-version.outputs.NEXT_VERSION_NO_PREFIX }}"
@@ -154,7 +154,7 @@ This repo uses [git-version-lite] in its workflows to examine commit messages to
154
154
155
155
### Source Code Changes
156
156
157
-
The files and directories that are considered source code are listed in the `files-with-code` and `dirs-with-code` arguments in both the [build-and-review-pr] and [increment-version-on-merge] workflows.
157
+
The files and directories that are considered source code are listed in the `files-with-code` and `dirs-with-code` arguments in both the [build-and-review-pr] and [increment-version-on-merge] workflows.
158
158
159
159
If a PR contains source code changes, the README.md should be updated with the latest action version and the action should be recompiled. The [build-and-review-pr] workflow will ensure these steps are performed when they are required. The workflow will provide instructions for completing these steps if the PR Author does not initially complete them.
160
160
@@ -175,7 +175,7 @@ If changes are made to the action's [source code], the [usage examples] section
175
175
176
176
### Tests
177
177
178
-
The [build-and-review-pr] workflow includes tests which are linked to a status check. That status check needs to succeed before a PR is merged to the default branch. When a PR comes from a branch, the workflow has access to secrets which are required to run the tests successfully.
178
+
The [build-and-review-pr] workflow includes tests which are linked to a status check. That status check needs to succeed before a PR is merged to the default branch. When a PR comes from a branch, the workflow has access to secrets which are required to run the tests successfully.
179
179
180
180
When a PR comes from a fork, the workflow cannot access any secrets, so the tests won't have the necessary permissions to run. When a PR comes from a fork, the changes should be reviewed, then merged into an intermediate branch by repository owners so tests can be run against the PR changes. Once the tests have passed, changes can be merged into the default branch.
0 commit comments