ninny 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +33 -0
- data/.github/workflows/scheduled.yml +1 -2
- data/.github/workflows/{main.yml → test.yml} +1 -1
- data/.ruby-version +1 -1
- data/Dockerfile +3 -0
- data/README.md +0 -1
- data/lib/ninny/cli.rb +2 -0
- data/lib/ninny/commands/pull_request_merge.rb +10 -2
- data/lib/ninny/commands/stage_up.rb +1 -0
- data/lib/ninny/git.rb +1 -1
- data/lib/ninny/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4912e477ddf25380dd14cbf7dad07184c9b7f002d781e781917112f45cc013
|
4
|
+
data.tar.gz: 6a144e8bd809018812ad9f441aa39db5c7853bb3e0d9224bdc50eef1d6633f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 436dd448436ce48fe2658d08b3cc68b1aedbda86796c836131b8f9845af39507ff99c806f276edafeebe57799db7086ff667c17a509466ec83ab38df22d7796a
|
7
|
+
data.tar.gz: dedd4a379d28c591424f2c40e7255d1151a278f9e8d2b1df7269ee5996edeb9d26339bf4f41582907acba0d06733b16b698a12a2364295b237ea33c9e9659273
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Build
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches: [ main ]
|
5
|
+
workflow_dispatch:
|
6
|
+
|
7
|
+
env:
|
8
|
+
REGISTRY: ghcr.io
|
9
|
+
IMAGE_NAME: ${{ github.repository }}
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
docker-build:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
permissions:
|
15
|
+
contents: read
|
16
|
+
packages: write
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
20
|
+
with:
|
21
|
+
registry: ${{ env.REGISTRY }}
|
22
|
+
username: ${{ github.actor }}
|
23
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
24
|
+
- uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
25
|
+
id: meta
|
26
|
+
with:
|
27
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
28
|
+
- uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
29
|
+
with:
|
30
|
+
context: .
|
31
|
+
push: true
|
32
|
+
tags: ${{ steps.meta.outputs.tags }}
|
33
|
+
labels: ${{ steps.meta.outputs.labels }}
|
@@ -5,7 +5,6 @@ on:
|
|
5
5
|
|
6
6
|
jobs:
|
7
7
|
bundler-audit:
|
8
|
-
if:
|
9
8
|
runs-on: ubuntu-latest
|
10
9
|
steps:
|
11
10
|
- uses: actions/checkout@v2
|
@@ -21,7 +20,7 @@ jobs:
|
|
21
20
|
bundler-audit
|
22
21
|
|
23
22
|
if [ $? -eq 0 ]; then
|
24
|
-
echo "No vulnerabilities found."
|
23
|
+
echo "No gem vulnerabilities found."
|
25
24
|
else
|
26
25
|
echo "Gem vulnerabilities found!"
|
27
26
|
exit 1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.2
|
data/Dockerfile
ADDED
data/README.md
CHANGED
data/lib/ninny/cli.rb
CHANGED
@@ -31,6 +31,8 @@ module Ninny
|
|
31
31
|
|
32
32
|
desc 'stage_up [PULL_REQUEST_ID]', 'Merges PR/MR into the staging branch'
|
33
33
|
method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information'
|
34
|
+
method_option :username, aliases: '-u', type: :string,
|
35
|
+
desc: "The name of the user who is staging up; defaults to the local git config's user"
|
34
36
|
def stage_up(pull_request_id = nil)
|
35
37
|
if options[:help]
|
36
38
|
invoke :help, ['stage_up']
|
@@ -6,7 +6,7 @@ module Ninny
|
|
6
6
|
module Commands
|
7
7
|
class PullRequestMerge < Ninny::Command
|
8
8
|
attr_accessor :pull_request_id, :options, :pull_request
|
9
|
-
attr_reader :branch_type
|
9
|
+
attr_reader :branch_type, :username
|
10
10
|
|
11
11
|
def initialize(pull_request_id, options)
|
12
12
|
@branch_type = options[:branch_type] || Ninny::Git::STAGING_PREFIX
|
@@ -65,7 +65,10 @@ module Ninny
|
|
65
65
|
#
|
66
66
|
# Returns a String
|
67
67
|
def comment_body
|
68
|
-
|
68
|
+
user = username || determine_local_user
|
69
|
+
body = "Merged into #{branch_to_merge_into}".dup
|
70
|
+
body << " by #{user}" if user
|
71
|
+
body << '.'
|
69
72
|
end
|
70
73
|
|
71
74
|
# Public: Find the pull request
|
@@ -83,6 +86,11 @@ module Ninny
|
|
83
86
|
def branch_to_merge_into
|
84
87
|
@branch_to_merge_into ||= Ninny.git.latest_branch_for(branch_type)
|
85
88
|
end
|
89
|
+
|
90
|
+
def determine_local_user
|
91
|
+
local_user_name = `git config user.name`.strip
|
92
|
+
local_user_name.empty? ? nil : local_user_name
|
93
|
+
end
|
86
94
|
end
|
87
95
|
end
|
88
96
|
end
|
data/lib/ninny/git.rb
CHANGED
@@ -95,7 +95,7 @@ module Ninny
|
|
95
95
|
rescue ::Git::GitExecuteError => e
|
96
96
|
if e.message.include?(':fatal: A branch named') && e.message.include?(' already exists')
|
97
97
|
puts "The local branch #{new_branch_name} already exists." \
|
98
|
-
|
98
|
+
' Please delete it manually and then run this command again.'
|
99
99
|
exit 1
|
100
100
|
end
|
101
101
|
end
|
data/lib/ninny/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ninny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dispatch Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
@@ -271,13 +271,15 @@ extensions: []
|
|
271
271
|
extra_rdoc_files: []
|
272
272
|
files:
|
273
273
|
- ".github/pull_request_template.md"
|
274
|
-
- ".github/workflows/
|
274
|
+
- ".github/workflows/build.yml"
|
275
275
|
- ".github/workflows/scheduled.yml"
|
276
|
+
- ".github/workflows/test.yml"
|
276
277
|
- ".gitignore"
|
277
278
|
- ".rspec"
|
278
279
|
- ".rubocop.yml"
|
279
280
|
- ".ruby-gemset"
|
280
281
|
- ".ruby-version"
|
282
|
+
- Dockerfile
|
281
283
|
- Gemfile
|
282
284
|
- Guardfile
|
283
285
|
- LICENSE.txt
|
@@ -326,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
328
|
- !ruby/object:Gem::Version
|
327
329
|
version: '0'
|
328
330
|
requirements: []
|
329
|
-
rubygems_version: 3.2.
|
331
|
+
rubygems_version: 3.2.22
|
330
332
|
signing_key:
|
331
333
|
specification_version: 4
|
332
334
|
summary: 'ninny (n): an foolish person, see: git'
|