git-lint 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.adoc +30 -0
- data/lib/git/lint.rb +1 -0
- data/lib/git/lint/branches/environments/git_hub_action.rb +28 -0
- data/lib/git/lint/branches/feature.rb +1 -0
- data/lib/git/lint/identity.rb +1 -1
- metadata +17 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad69b383eac0eec9f092da4cdfb914481b634357ddd4231b35990b7d5d3c7f58
|
4
|
+
data.tar.gz: 42f72eda7f6519e4d86329691853e751234e4c6cf044dd02538df018762ad29c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c68bb8ab97984d8dff32760849a9c09826810a390a7269debba43415f24d7b6141561d24a3537f5c080a448bcecefb4e4c8fa1435f03ef2c2062028e8063122c
|
7
|
+
data.tar.gz: 546178cb0708443ec30e0740629653482eb01e4dca0120fe2ae50116f3e5b07066daf7668871bb71f34b10d1e8775dd44518915b66f495d24d4a1c3acd23ee9e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -383,6 +383,36 @@ from `master`.
|
|
383
383
|
Detection and configuration happens automatically by checking the `CIRCLECI` environment variable.
|
384
384
|
No additional setup required!
|
385
385
|
|
386
|
+
==== link:https://docs.github.com/en/free-pro-team@latest/actions[GitHub Actions]
|
387
|
+
|
388
|
+
Detection happens automatically by checking the `GITHUB_ACTIONS` environment variable as supplied by
|
389
|
+
the GitHub environment. The only configuration required is to add a `.github/workflows/git_lint.yml`
|
390
|
+
to your repository with the following contents:
|
391
|
+
|
392
|
+
[source,yaml]
|
393
|
+
----
|
394
|
+
name: Git Lint
|
395
|
+
|
396
|
+
on: pull_request
|
397
|
+
|
398
|
+
jobs:
|
399
|
+
run:
|
400
|
+
runs-on: ubuntu-latest
|
401
|
+
container:
|
402
|
+
image: ruby:latest
|
403
|
+
steps:
|
404
|
+
- uses: actions/checkout@v2
|
405
|
+
with:
|
406
|
+
fetch-depth: '0'
|
407
|
+
ref: ${{github.head_ref}}
|
408
|
+
- name: Install
|
409
|
+
run: gem install git-lint
|
410
|
+
- name: Analyze
|
411
|
+
run: git-lint --analyze
|
412
|
+
----
|
413
|
+
|
414
|
+
The above will ensure Git Lint runs as an additional check on each Pull Request.
|
415
|
+
|
386
416
|
==== link:https://www.netlify.com[Netlify CI]
|
387
417
|
|
388
418
|
Detection and configuration happens automatically by checking the `NETLIFY` environment variable. No
|
data/lib/git/lint.rb
CHANGED
@@ -15,6 +15,7 @@ require "git/lint/commits/saved"
|
|
15
15
|
require "git/lint/commits/unsaved"
|
16
16
|
require "git/lint/branches/environments/local"
|
17
17
|
require "git/lint/branches/environments/circle_ci"
|
18
|
+
require "git/lint/branches/environments/git_hub_action"
|
18
19
|
require "git/lint/branches/environments/netlify_ci"
|
19
20
|
require "git/lint/branches/environments/travis_ci"
|
20
21
|
require "git/lint/branches/feature"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Git
|
4
|
+
module Lint
|
5
|
+
module Branches
|
6
|
+
module Environments
|
7
|
+
# Provides GitHub Action build environment feature branch information.
|
8
|
+
class GitHubAction
|
9
|
+
def initialize repo: Git::Kit::Repo.new
|
10
|
+
@repo = repo
|
11
|
+
end
|
12
|
+
|
13
|
+
def name
|
14
|
+
"origin/#{repo.branch_name}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def shas
|
18
|
+
repo.shas start: "origin/master", finish: name
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
attr_reader :repo
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -29,6 +29,7 @@ module Git
|
|
29
29
|
|
30
30
|
def load_environment
|
31
31
|
if key? "CIRCLECI" then Environments::CircleCI.new
|
32
|
+
elsif key? "GITHUB_ACTIONS" then Environments::GitHubAction.new
|
32
33
|
elsif key? "NETLIFY" then Environments::NetlifyCI.new environment: current_environment
|
33
34
|
elsif key? "TRAVIS" then Environments::TravisCI.new environment: current_environment
|
34
35
|
else Environments::Local.new
|
data/lib/git/lint/identity.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
|
29
29
|
QWc=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2020-
|
31
|
+
date: 2020-11-01 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: pastel
|
@@ -100,6 +100,20 @@ dependencies:
|
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0.6'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: bundler-leak
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.2'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.2'
|
103
117
|
- !ruby/object:Gem::Dependency
|
104
118
|
name: gemsmith
|
105
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -306,6 +320,7 @@ files:
|
|
306
320
|
- lib/git/lint/analyzers/commit_trailer_collaborator_key.rb
|
307
321
|
- lib/git/lint/analyzers/commit_trailer_collaborator_name.rb
|
308
322
|
- lib/git/lint/branches/environments/circle_ci.rb
|
323
|
+
- lib/git/lint/branches/environments/git_hub_action.rb
|
309
324
|
- lib/git/lint/branches/environments/local.rb
|
310
325
|
- lib/git/lint/branches/environments/netlify_ci.rb
|
311
326
|
- lib/git/lint/branches/environments/travis_ci.rb
|
metadata.gz.sig
CHANGED
Binary file
|