File tree 4 files changed +43
-23
lines changed
4 files changed +43
-23
lines changed Original file line number Diff line number Diff line change 12
12
steps :
13
13
- name : Check out
14
14
uses : actions/checkout@v2
15
+ with :
16
+ fetch-depth : 0
15
17
- name : Create bump and changelog
16
18
uses : Woile/commitizen-action@master
17
- with :
18
- dry_run : false
19
- - name : Push changes back to master
20
- uses : ad-m/github-push-action@master
21
19
with :
22
20
github_token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 20
20
jobs :
21
21
bump_version :
22
22
runs-on : ubuntu-latest
23
- name : ' Bump version and create changelog with commitizen'
23
+ name : " Bump version and create changelog with commitizen"
24
24
steps :
25
- - name : Check out
26
- uses : actions/checkout@v2
27
- - name : Create bump and changelog
28
- uses : Woile/commitizen-action@master
29
- with :
30
- dry_run : false
31
- - name : Push changes back to master
32
- uses : ad-m/github-push-action@master
33
- with :
34
- github_token : ${{ secrets.GITHUB_TOKEN }}
35
-
25
+ - name : Check out
26
+ uses : actions/checkout@v2
27
+ with :
28
+ fetch-depth : 0
29
+ - name : Create bump and changelog
30
+ uses : Woile/commitizen-action@master
31
+ with :
32
+ github_token : ${{ secrets.GITHUB_TOKEN }}
36
33
` ` `
37
34
38
35
## Variables
39
36
40
- | Name | Description | Default |
41
- | ----------- | --------------------------------------------- | ------- |
42
- | ` dry_run ` | Run without creating commit, output to stdout | false |
43
- | ` changelog ` | Create changelog when bumping the version | true |
37
+ | Name | Description | Default |
38
+ | -------------- | ------------------------------------------------------------------------------------------------------------ | ----------- |
39
+ | ` github_token` | Token for the repo. Can be passed in using \$\{{ secrets.GITHUB_TOKEN }} **required** | - |
40
+ | `dry_run` | Run without creating commit, output to stdout | false |
41
+ | `repository` | Repository name to push. Default or empty value represents current github repository (\${GITHUB_REPOSITORY}) | current one |
42
+ | `branch` | Destination branch to push changes | `master` |
43
+
44
+ <!-- | `changelog` | Create changelog when bumping the version | true | -->
44
45
45
46
# # Contributing
46
47
Original file line number Diff line number Diff line change @@ -14,4 +14,15 @@ inputs:
14
14
changelog :
15
15
description : ' Create changelog when bumping the version'
16
16
default : " true"
17
- required : false
17
+ required : false
18
+ github_token :
19
+ description : ' Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}'
20
+ required : true
21
+ repository :
22
+ description : ' Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
23
+ default : ' '
24
+ required : false
25
+ branch :
26
+ description : ' Destination branch to push changes'
27
+ required : false
28
+ default : ' master'
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
: " ${INPUT_DRY_RUN:= false} "
4
+ INPUT_BRANCH=${INPUT_BRANCH:- master}
5
+ REPOSITORY=${INPUT_REPOSITORY:- $GITHUB_REPOSITORY }
4
6
# : "${INPUT_CHANGELOG:=true}" ignroed for now, let's check that it works
5
7
6
8
set -e
7
9
8
- echo " Repository: $GITHUB_REPOSITORY "
10
+ [ -z " ${INPUT_GITHUB_TOKEN} " ] && {
11
+ echo ' Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".' ;
12
+ exit 1;
13
+ };
14
+
15
+ echo " Repository: $REPOSITORY "
9
16
echo " Actor: $GITHUB_ACTOR "
10
17
11
18
echo " Installing requirements..."
12
-
13
19
if [[ -f " requirements.txt" ]]; then
14
20
# Ensure commitizen + reqs may have custom commitizen plugins
15
21
pip install -r requirements.txt commitizen
28
34
cz bump --yes --changelog --dry-run
29
35
fi
30
36
37
+ echo " Pushing to branch..."
38
+ remote_repo=" https://${GITHUB_ACTOR} :${INPUT_GITHUB_TOKEN} @github.com/${REPOSITORY} .git"
39
+ git push " ${remote_repo} " HEAD:${INPUT_BRANCH} --follow-tags --tags;
40
+
31
41
echo " Done."
You can’t perform that action at this time.
0 commit comments