File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,30 @@ bump libs/xyz from 0.0.0 to 0.1.0
76
76
# creates a tag `libs/xyz/0.1.0`
77
77
```
78
78
79
+ ## Usage in GitHub Actions
80
+
81
+ The following example shows a workflow using git-semver in GitHub Actions:
82
+
83
+ ``` yaml
84
+ name : Bump
85
+
86
+ jobs :
87
+ bump :
88
+ runs-on : ubuntu-latest
89
+ steps :
90
+ - uses : actions/checkout@v2
91
+ with :
92
+ fetch-depth : 0
93
+
94
+ -
uses :
carlsberg/[email protected]
95
+ with :
96
+ script : |
97
+ echo "Latest Version: $(git semver latest)"
98
+ echo "Next Version: $(git semver next)"
99
+
100
+ git semver bump -u ${{ github.actor }} -P ${{ github.token }}
101
+ ` ` `
102
+
79
103
## License
80
104
81
105
This project is released under the [MIT License](LICENSE).
Original file line number Diff line number Diff line change
1
+ name : Git SemVer
2
+ description : Installs and runs git-semver
3
+
4
+ inputs :
5
+ script :
6
+ description : Shell script to run
7
+ required : true
8
+
9
+ runs :
10
+ using : composite
11
+ steps :
12
+ - id : version
13
+ run : |
14
+ v="${{ github.action_ref }}"
15
+ v=$(echo "${v:1}")
16
+ echo "::set-output name=version::$v"
17
+ shell : bash
18
+
19
+ - run : |
20
+ v="${{ steps.version.outputs.version }}"
21
+ url="https://github.com/carlsberg/git-semver/releases/download/v$v/git-semver_$v_Linux_x86_64.tar.gz"
22
+ curl -L "$url" >> git-semver.tar.gz
23
+ tar -xvzf git-semver.tar.gz
24
+ mkdir $HOME/.local/bin && mv git-semver $HOME/.local/bin
25
+ echo $HOME/.local/bin >> $GITHUB_PATH
26
+ shell: bash
27
+
28
+ - run : |
29
+ echo '${{ inputs.runs }}' >> script.sh
30
+ chmod +x script.sh
31
+ ./script.sh
32
+ shell: bash
You can’t perform that action at this time.
0 commit comments