-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (121 loc) · 3.93 KB
/
Copy pathcommitmsg-conform.yml
File metadata and controls
123 lines (121 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Commit Message Conformance
on:
workflow_call:
inputs:
config:
type: string
default: |
policies:
- type: commit
spec:
dco: false
gpg:
required: false
gitHubOrganization: aws-user-group-nz
spellcheck:
locale: US
maximumOfOneCommit: false
header:
length: 89
imperative: true
case: lower
invalidLastCharacters: .
body:
required: true
conventional:
types:
- chore
- ci
- docs
- feat
- fix
- refactor
- release
- revert
- style
- test
scopes: [".*"]
jobs:
conform:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- id: determine-existing-config
run: |
if [ -f .conform.yaml ]; then
echo "exists=true" >> $GITHUB_OUTPUT
fi
- name: write config
if: ${{ steps.determine-existing-config.outputs.exists != 'true' }}
run: |
cat << EOF > .conform.yaml
${{ inputs.config }}
EOF
- name: conform
env:
INPUT_TOKEN: ${{ github.token }}
run: |
docker run \
-e "ACTIONS_CACHE_URL" \
-e "ACTIONS_RUNTIME_TOKEN" \
-e "ACTIONS_RUNTIME_URL" \
-e "GITHUB_ACTION" \
-e "GITHUB_ACTION_REF" \
-e "GITHUB_ACTION_REPOSITORY" \
-e "GITHUB_ACTOR" \
-e "GITHUB_ACTOR_ID" \
-e "GITHUB_API_URL" \
-e "GITHUB_BASE_REF" \
-e "GITHUB_ENV" \
-e "GITHUB_EVENT_NAME" \
-e "GITHUB_EVENT_PATH" \
-e "GITHUB_GRAPHQL_URL" \
-e "GITHUB_HEAD_REF" \
-e "GITHUB_JOB" \
-e "GITHUB_OUTPUT" \
-e "GITHUB_PATH" \
-e "GITHUB_REF" \
-e "GITHUB_REF_NAME" \
-e "GITHUB_REF_PROTECTED" \
-e "GITHUB_REF_TYPE" \
-e "GITHUB_REPOSITORY" \
-e "GITHUB_REPOSITORY_ID" \
-e "GITHUB_REPOSITORY_OWNER" \
-e "GITHUB_REPOSITORY_OWNER_ID" \
-e "GITHUB_RETENTION_DAYS" \
-e "GITHUB_RUN_ATTEMPT" \
-e "GITHUB_RUN_ID" \
-e "GITHUB_RUN_NUMBER" \
-e "GITHUB_SERVER_URL" \
-e "GITHUB_SHA" \
-e "GITHUB_STATE" \
-e "GITHUB_STEP_SUMMARY" \
-e "GITHUB_TRIGGERING_ACTOR" \
-e "GITHUB_WORKFLOW" \
-e "GITHUB_WORKFLOW_REF" \
-e "GITHUB_WORKFLOW_SHA" \
-e "GITHUB_WORKSPACE" \
-e "HOME" \
-e "INPUT_ARGS" \
-e "RUNNER_ARCH" \
-e "RUNNER_ENVIRONMENT" \
-e "RUNNER_NAME" \
-e "RUNNER_OS" \
-e "RUNNER_TEMP" \
-e "RUNNER_TOOL_CACHE" \
-e "RUNNER_WORKSPACE" \
-e CI=true \
-e GITHUB_ACTIONS=true \
-e GITHUB_EVENT_PATH=/github/workflow/event.json \
-e INPUT_TOKEN="$INPUT_TOKEN" \
-v "$PWD":"/github/workspace" \
-v "/home/runner/work/_temp/_github_home":"/github/home" \
-v "/home/runner/work/_temp/_github_workflow":"/github/workflow" \
-v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" \
--workdir /github/workspace \
ghcr.io/siderolabs/conform:v0.1.0-alpha.30-1-ga6572d2 \
enforce --commit-ref="refs/remotes/origin/main" --reporter=github