Skip to content

Commit c1a904e

Browse files
Merge pull request #19 from im-open/create-major-tag
TW-64305: Create Major version tag on merge
2 parents d0e2b31 + 0213b70 commit c1a904e

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.github/workflows/increment-version-on-merge.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,23 @@ jobs:
3838
with:
3939
ref: main
4040
fetch-depth: 0
41-
persist-credentials: false
4241

4342
# See https://github.com/im-open/git-version-lite for more details around how to increment
4443
# major/minor/patch through commit messages
4544
- name: Increment the version
46-
uses: im-open/git-version-lite@v2.1.2
45+
uses: im-open/git-version-lite@v2
46+
id: version
4747
with:
48-
create-ref: true
4948
github-token: ${{ secrets.GITHUB_TOKEN }}
5049
default-release-type: major
50+
51+
- name: Create version tag, create or update major, and minor tags
52+
run: |
53+
git config user.name github-actions
54+
git config user.email github-actions@github.com
55+
git tag ${{ steps.version.outputs.NEXT_VERSION }} ${{ github.sha }}
56+
git tag -f ${{ steps.version.outputs.NEXT_MAJOR_VERSION }} ${{ github.sha }}
57+
git tag -f ${{ steps.version.outputs.NEXT_MINOR_VERSION }} ${{ github.sha }}
58+
git push origin ${{ steps.version.outputs.NEXT_VERSION }}
59+
git push origin ${{ steps.version.outputs.NEXT_MAJOR_VERSION }} -f
60+
git push origin ${{ steps.version.outputs.NEXT_MINOR_VERSION }} -f

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
steps:
6161
- name: Set environment scope
6262
id: env-scope
63-
uses: im-open/set-environment-variables-by-scope@v1.1.2
63+
uses: im-open/set-environment-variables-by-scope@v1.1.3
6464
with:
6565
scope: ${{ workflow.inputs.environment }}
6666
create-output-variables: true
@@ -84,7 +84,8 @@ jobs:
8484
# The set-environment-variables-by-scope action uses both the input-file and
8585
# the supplied env variables to create the resulting environment and output vars
8686
- name: Build Workflow Environment Variables
87-
uses: im-open/set-environment-variables-by-scope@v1.1.2
87+
# You may also reference just the major or major.minor version
88+
uses: im-open/set-environment-variables-by-scope@v1.1.3
8889
with:
8990
scope: ${{ needs.setup.outputs.env-scope }}
9091
input-file: ./env-vars.yml
@@ -179,7 +180,7 @@ jobs:
179180
180181
steps:
181182
- name: Build DB Connection
182-
uses: im-open/set-environment-variables-by-scope@v1.1.2
183+
uses: im-open/set-environment-variables-by-scope@v1.1.3
183184
with:
184185
scope: ${{ needs.setup.outputs.env-scope }}
185186
env:
@@ -244,4 +245,4 @@ This project has adopted the [im-open's Code of Conduct](https://github.com/im-o
244245

245246
Copyright © 2021, Extend Health, LLC. Code released under the [MIT license](LICENSE).
246247

247-
[git-version-lite]: https://github.com/im-open/git-version-lite
248+
[git-version-lite]: https://github.com/im-open/git-version-lite

action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
name: 'Set Environment Variables by Scope'
2-
3-
description: 'This action takes specially formatted environment variables and/or an input file to emit scoped environment variables.'
1+
name: Set Environment Variables by Scope
2+
description: This action takes specially formatted environment variables and/or an input file to emit scoped environment variables.
43

54
inputs:
65
scope:

0 commit comments

Comments
 (0)