octokitted 0.0.7 → 0.0.9
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
- data/lib/octokitted.rb +10 -3
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eb37191994ca5fbce98292fa7d110d1b8ba0cef9adbfdcee64ff9a4c86783c5
|
4
|
+
data.tar.gz: dddf0023f475c442215e2c73c0112782cbef093c4725d321e72d3bcff9edffaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 256b887a612783254b34ccabb3f4e8c348df57656f1562507453802bf37252214157164f79d45032ef8231e05ccc46b8b25f4a82e8f9850b17eff5ff5e7249c8
|
7
|
+
data.tar.gz: dc678d7dd0658e9ea8e0d8983b99f17784836140140b31e303b5718b7c39d465706db56061a9d26e79d48ea609b83599c6b2b61eed5330309f07a389ad0ce55d
|
data/lib/octokitted.rb
CHANGED
@@ -40,7 +40,7 @@ class Octokitted
|
|
40
40
|
@cloned_repos = []
|
41
41
|
@event_path = event_path || ENV.fetch("GITHUB_EVENT_PATH", nil)
|
42
42
|
@sha = ENV.fetch("GITHUB_SHA", nil)
|
43
|
-
org_and_repo_hash = fetch_org_and_repo
|
43
|
+
org_and_repo_hash = fetch_org_and_repo(org, repo)
|
44
44
|
@login = login
|
45
45
|
@org = org || org_and_repo_hash[:org]
|
46
46
|
@repo = repo || org_and_repo_hash[:repo]
|
@@ -137,8 +137,11 @@ class Octokitted
|
|
137
137
|
|
138
138
|
# Fetch the org and repo from the environment
|
139
139
|
# :return: A hash containing the org and repo, and the org and repo separately
|
140
|
-
Contract
|
141
|
-
def fetch_org_and_repo
|
140
|
+
Contract Maybe[String], Maybe[String] => Hash
|
141
|
+
def fetch_org_and_repo(org, repo)
|
142
|
+
# if org and repo are provided, and not nil, use them
|
143
|
+
return { org_and_repo: "#{org}/#{repo}", org:, repo: } if org && repo
|
144
|
+
|
142
145
|
org_and_repo = ENV.fetch("GITHUB_REPOSITORY", nil)
|
143
146
|
org = nil
|
144
147
|
repo = nil
|
@@ -156,6 +159,10 @@ class Octokitted
|
|
156
159
|
# :return: A Hash of the GitHub event data or nil if not found
|
157
160
|
Contract Maybe[String] => Maybe[Hash]
|
158
161
|
def fetch_github_event(event_path)
|
162
|
+
if ENV.fetch("GITHUB_ACTIONS", nil).nil?
|
163
|
+
@log.debug("Not running in GitHub Actions - GitHub Event data not auto-hydrated")
|
164
|
+
return nil
|
165
|
+
end
|
159
166
|
unless event_path
|
160
167
|
@log.warn("GITHUB_EVENT_PATH env var not found")
|
161
168
|
return nil
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokitted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Birkinbine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contracts
|