1
+ [ ![ Tests] [ tests-badge ]] [ tests-link ]
2
+ [ ![ GitHub Release] [ release-badge ]] [ release-link ]
3
+ [ ![ Go Report Card] [ report-badge ]] [ report-link ]
4
+ [ ![ License] [ license-badge ]] [ license-link ]
5
+
1
6
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
7
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
- ** Table of Contents** * generated with [ DocToc ] ( https://github.com/thlorenz/doctoc ) *
8
+ ** Table of Contents**
4
9
5
10
- [ github-flow-manager] ( #github-flow-manager )
6
11
- [ Help] ( #help )
7
12
- [ Example] ( #example )
8
13
- [ Pre commit] ( #pre-commit )
9
- - [ Expressions] ( #expressions )
14
+ - [ Expressions] ( #expressions )
10
15
- [ Available variables] ( #available-variables )
11
- - [ Examples] ( #examples )
16
+ - [ Examples] ( #examples )
17
+ - [ Commit message contains "string"] ( #commit-message-contains-string )
18
+ - [ Commit message not contains "string"] ( #commit-message-not-contains-string )
19
+ - [ Commit message equals "string"] ( #commit-message-equals-string )
20
+ - [ Commit status is SUCCESS] ( #commit-status-is-success )
21
+ - [ Commit was pushed more than 30 minutes ago] ( #commit-was-pushed-more-than-30-minutes-ago )
22
+ - [ Commit was pushed more than 30 minutes ago and status is SUCCESS] ( #commit-was-pushed-more-than-30-minutes-ago-and-status-is-success )
12
23
- [ How to build] ( #how-to-build )
13
24
14
25
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
15
26
16
27
# github-flow-manager
28
+
17
29
## Help
18
- ```
30
+
31
+ ``` sh
19
32
Main goal for that app is to push commits between branches
20
33
but just those which pass evaluation checks.
21
34
Example use case " push all commits pushed to branch develop more than 30 minutes ago to branch master"
@@ -34,64 +47,91 @@ Flags:
34
47
```
35
48
36
49
## Example
50
+
37
51
- Evaluating commit status success based on the cumulative commit checks result
38
- ```
52
+
53
+ ```sh
39
54
GITHUB_TOKEN=xxx github-flow-manager octocat Hello-World test master "StatusSuccess == false" --verbose --dry-run
40
55
```
56
+
41
57
- Passing specific commit check name for the evaluation of the status success of the commit
42
- ```
58
+
59
+ ```sh
43
60
GITHUB_TOKEN=xxx github-flow-manager octocat Hello-World test master "StatusSuccess == false" "pipeline-name-to-be-checked" --verbose --dry-run
44
61
GITHUB_TOKEN=xxx github-flow-manager octocat Hello-World test master "StatusSuccess == false" "pipeline-1-name-to-be-checked,pipeline-2-name-to-be-checked" --verbose --dry-run
45
62
```
46
63
47
64
## Pre commit
48
65
49
66
This repo leverage pre commit to lint, secure, document the IaaC codebase. The pre-commit configuration require the following dependencies:
67
+
50
68
- [pre-commit](https://pre-commit.com/#install)
51
69
- [golangci-lint](https://golangci-lint.run/usage/install/#local-installation)
52
70
53
71
**One first repo download, to install the pre-commit hooks run**: `pre-commit install`, to run the hooks at will run: `pre-commit run -a`
54
72
55
- # Expressions
73
+ ## Expressions
74
+
56
75
### Available variables
57
- - ` SHA `
58
- - ` Message `
59
- - ` PushedDate ` - when commit was pushed
60
- - ` StatusSuccess ` - f.ex. CI status
61
76
62
- ### Examples
63
- ##### Commit message contains "string"
77
+ - `SHA`
78
+ - `Message`
79
+ - `PushedDate` - when commit was pushed
80
+ - `StatusSuccess` - f.ex. CI status
81
+
82
+ ## Examples
83
+
84
+ ### Commit message contains "string"
85
+
64
86
`Message contains "HOTFIX"`
65
- ##### Commit message not contains "string"
87
+
88
+ ### Commit message not contains "string"
89
+
66
90
`Message NOT contains "FEATURE"`
67
- ##### Commit message equals "string"
91
+
92
+ ### Commit message equals "string"
93
+
68
94
`Message == "very important commit"`
69
- ##### Commit status is SUCCESS
95
+
96
+ ### Commit status is SUCCESS
97
+
70
98
`StatusSuccess == true`
71
- ##### Commit was pushed more than 30 minutes ago
99
+
100
+ ### Commit was pushed more than 30 minutes ago
101
+
72
102
`PushedDate < "now-30m"`
73
- ##### Commit was pushed more than 30 minutes ago and status is SUCCESS
103
+
104
+ ### Commit was pushed more than 30 minutes ago and status is SUCCESS
105
+
74
106
`PushedDate < "now-30m" AND StatusSuccess == true`
75
107
76
108
## How to build
77
109
78
110
You will need:
79
- * ` goreleaser ` binary
80
- * Github access using token
81
- * Docker image push access
111
+
112
+ - Permissions to create tags in `master` branch
82
113
83
114
Check tags
84
- ```
115
+
116
+ ```sh
85
117
git tag
86
118
```
87
119
88
- Tag your changes
89
- ```
120
+ Tag your changes to create a new release with the tag specified:
121
+
122
+ ```sh
90
123
git tag -a v1.0.X -m "fix"
91
124
```
92
125
93
- Release
94
- Note: you should generate your Personal Access Token with ` write packages ` scope enabled
95
- ```
96
- GITHUB_TOKEN=<PERSONAL_ACCESS_TOKEN> goreleaser release
97
- ```
126
+ <!-- JUST BADGES & LINKS -->
127
+ [tests-badge]: https://img.shields.io/github/workflow/status/DocPlanner/github-flow-manager/Tests
128
+ [tests-link]: https://github.com/DocPlanner/github-flow-manager/actions?query=workflow%3ATests
129
+
130
+ [release-badge]: https://img.shields.io/github/release/DocPlanner/github-flow-manager.svg?logo=github&labelColor=262b30
131
+ [release-link]: https://github.com/DocPlanner/github-flow-manager/releases
132
+
133
+ [report-badge]: https://goreportcard.com/badge/github.com/DocPlanner/github-flow-manager
134
+ [report-link]: https://goreportcard.com/report/github.com/DocPlanner/github-flow-manager
135
+
136
+ [license-badge]: https://img.shields.io/github/license/DocPlanner/github-flow-manager
137
+ [license-link]: https://github.com/DocPlanner/github-flow-manager/blob/master/LICENSE
0 commit comments