Skip to content

Commit 7d72e84

Browse files
committed
MAJOR: move source to root directory
github.com:haproxytech/github-actions was separated to two projects. Both actions got their own repos
1 parent 941c5ab commit 7d72e84

File tree

12 files changed

+87
-133
lines changed

12 files changed

+87
-133
lines changed

.github/workflows/actions.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ jobs:
88
- uses: actions/checkout@v2
99
- name: golangci-lint
1010
uses: golangci/golangci-lint-action@v2
11-
with:
12-
working-directory: check-commit
1311
check_commit:
1412
if: ${{ github.event_name == 'pull_request' }}
1513
name: HAProxy check commit message
@@ -36,10 +34,10 @@ jobs:
3634
id: go
3735
- name: Get dependencies
3836
run: |
39-
cd check-commit && go get -v -t -d ./...
37+
go get -v -t -d ./...
4038
- name: Build
4139
run: |
42-
cd check-commit && go build -v .
40+
go build -v .
4341
go_test:
4442
name: Go test
4543
runs-on: ubuntu-latest
@@ -52,7 +50,7 @@ jobs:
5250
id: go
5351
- name: Get dependencies
5452
run: |
55-
cd check-commit && go get -v -t -d ./...
53+
go get -v -t -d ./...
5654
- name: Build
5755
run: |
58-
cd check-commit && go test ./...
56+
go test ./...
File renamed without changes.

check-commit/Dockerfile renamed to Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ WORKDIR /build
55
RUN go build -o check check.go
66

77
FROM alpine:latest
8-
LABEL maintainer="mmhedhbi@haproxy.com"
98
COPY --from=builder /build/check /check
109
WORKDIR /
1110
ENTRYPOINT ["/check"]
12-

README.md

Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,96 @@
1-
# ![HAProxy](https://github.com/haproxytech/kubernetes-ingress/raw/master/assets/images/haproxy-weblogo-210x49.png "HAProxy")
1+
![check-commit; golangci-lint](https://github.com/haproxytech/github-actions/actions/workflows/main.yml/badge.svg)
22

3-
## HAProxy Github Actions
3+
# GitHub Action: Check commit subject is compliant with HAProxy guidelines
44

5+
This action checks that the commit subject is compliant with the [patch classifying rules](https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING#L632) of HAProxy contribution guidelines. Also it does minimal check for a meaningful message in the commit subject: no less than 20 characters and at least 3 words.
56

6-
This repository contains Github Actions used in CI/CD workflows of [HAProxy Technologies](https://www.haproxy.com/) repositories hosted in Github.
7+
## Examples
78

8-
## Usage
9+
### Good
10+
11+
- Bug fix:
12+
```
13+
BUG/MEDIUM: fix set-var parsing bug in config-parser
14+
```
15+
- New minor feature:
16+
```
17+
MINOR: Add path-rewrite annotation
18+
```
19+
- Minor build update:
20+
```
21+
BUILD/MINOR: Add path-rewrite annotation
22+
```
23+
24+
### Bad
25+
26+
- Incorrect patch type
27+
```
28+
bug: fix set-var parsing bug in config-parser
29+
```
30+
- Short commit message
31+
```
32+
BUG/MEDIUM: fix set-var
33+
```
34+
- Unkown severity
35+
```
36+
BUG/MODERATE: fix set-var parsing bug in config-parser
37+
```
38+
39+
40+
## Inputs
941

10-
- Using action via Docker container image on Docker Hub:
42+
None.
43+
44+
## Usage
1145

1246
```yaml
1347
steps:
14-
- name: Check out code
15-
uses: actions/checkout@v2
16-
- name: action-name
17-
uses: docker://haproxytech/action-name:TAG
48+
- name: check-commit
49+
uses: docker://haproxytech/check-commit:TAG
50+
env:
51+
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1852
```
53+
Check-commit works only on `pull_request` events by inspecting all commit messages in a Pull Request. It uses Github API [pull requests API](https://docs.github.com/en/rest/reference/pulls#list-commits-on-a-pull-request) to fetch the commits so API_TOKEN env_variable is required.
54+
55+
## Example configuration
1956

20-
- Using action via HAProxyTech repository:
57+
If a configuration file (`.check-commit.yml`) is not available in the running directory, a built-in failsafe configuration identical to the one below is used.
2158

2259
```yaml
23-
steps:
24-
- name: Check out code
25-
uses: actions/checkout@v2
26-
- name: action-name
27-
uses: haproxytech/github-actions/action-name@TAG
60+
---
61+
HelpText: "Please refer to https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING#L632"
62+
PatchScopes:
63+
HAProxy Standard Scope:
64+
- MINOR
65+
- MEDIUM
66+
- MAJOR
67+
- CRITICAL
68+
PatchTypes:
69+
HAProxy Standard Patch:
70+
Values:
71+
- BUG
72+
- BUILD
73+
- CLEANUP
74+
- DOC
75+
- LICENSE
76+
- OPTIM
77+
- RELEASE
78+
- REORG
79+
- TEST
80+
- REVERT
81+
Scope: HAProxy Standard Scope
82+
HAProxy Standard Feature Commit:
83+
Values:
84+
- MINOR
85+
- MEDIUM
86+
- MAJOR
87+
- CRITICAL
88+
TagOrder:
89+
- PatchTypes:
90+
- HAProxy Standard Patch
91+
- HAProxy Standard Feature Commit
2892
```
93+
94+
### Optional parameters
95+
96+
The program accepts an optional parameter to specify the location (path) of the base of the git repository. This can be useful in certain cases where the checked-out repo is in a non-standard location within the CI environment, compared to the running path from which the check-commit binary is being invoked.

check-commit/README.md

Lines changed: 0 additions & 96 deletions
This file was deleted.

check-commit/action.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)