danger-spm_version_updates 3.0.1 → 3.1.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
- data/README.md +22 -1
- data/lib/spm_version_updates/plugin.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc9e706571bc67abd0fa0ecaa3bffdfb388fd138cf14873b5a59525f9b990236
|
|
4
|
+
data.tar.gz: 2b46d334171515951b469bfbc42c1e8ad948249b4eeed9b613d7c1b72891d86f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 29c8ea06fdbbb2f4559e0388fa27aad8b81a5a169fbf243baf83c16ca9cb5fe6407450d3e9abaa1f403c641fa72655eaa867629f09949141dcffd25917583747
|
|
7
|
+
data.tar.gz: fe0a5a32af5e36ecc449080ad40bf767495f5d195781369cda992b7758728704ff2e8cca2c58ecb35590c7cb0032f28ee39995c8e9a20a1e253a06317c39009e
|
data/README.md
CHANGED
|
@@ -48,7 +48,28 @@ command in manifest mode.
|
|
|
48
48
|
|
|
49
49
|
The configurable accessors are: `check_when_exact`, `check_branches`,
|
|
50
50
|
`check_revisions`, `report_above_maximum`, `report_pre_releases`,
|
|
51
|
-
`ignore_repos`, and `
|
|
51
|
+
`ignore_repos`, `repo_rules_path`, and `allow_hosts` (3.1.0+).
|
|
52
|
+
|
|
53
|
+
### Checking untrusted dependency URLs
|
|
54
|
+
|
|
55
|
+
The `allow_hosts` setting requires version **3.1.0 or newer**. To use it,
|
|
56
|
+
specify a compatible version in your Gemfile:
|
|
57
|
+
|
|
58
|
+
```ruby
|
|
59
|
+
gem "danger-spm_version_updates", "~> 3.1"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Set the expected hostnames before calling the checker in your trusted Dangerfile:
|
|
63
|
+
|
|
64
|
+
```ruby
|
|
65
|
+
spm_version_updates.allow_hosts = ["github.com"]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The checker validates the declared URL hostname before asking Git to look up
|
|
69
|
+
a dependency. Matching is exact and case-insensitive. An empty list skips
|
|
70
|
+
hostname validation. An off-list hostname raises before Git runs for that
|
|
71
|
+
dependency. Use a trusted working directory, bundle, and Ruby configuration
|
|
72
|
+
for privileged jobs that read fork manifests. See the [security guide](https://github.com/hbmartin/github-action-spm_version_updates/blob/main/docs/security.md#danger-plugin-on-untrusted-pull-requests).
|
|
52
73
|
|
|
53
74
|
## License
|
|
54
75
|
|
|
@@ -12,6 +12,10 @@ module Danger
|
|
|
12
12
|
# @example Check dependencies declared in Package.swift manifests
|
|
13
13
|
# spm_version_updates.check_manifests(["Modules/Package.swift"])
|
|
14
14
|
#
|
|
15
|
+
# @example Validate declared dependency hostnames before version lookups
|
|
16
|
+
# spm_version_updates.allow_hosts = ["github.com"]
|
|
17
|
+
# spm_version_updates.check_manifests(["Modules/Package.swift"])
|
|
18
|
+
#
|
|
15
19
|
# @see hbmartin/danger-spm_version_updates
|
|
16
20
|
# @tags swift, spm, swift package manager, xcode, xcodeproj, version, updates
|
|
17
21
|
#
|
|
@@ -44,6 +48,11 @@ module Danger
|
|
|
44
48
|
# @return [String]
|
|
45
49
|
attr_accessor :repo_rules_path
|
|
46
50
|
|
|
51
|
+
# Declared hostnames allowed for version lookups, default empty (no validation).
|
|
52
|
+
# A lookup with an off-list hostname raises before Git runs for that dependency.
|
|
53
|
+
# @return [Array<String>]
|
|
54
|
+
attr_accessor :allow_hosts
|
|
55
|
+
|
|
47
56
|
# A method that you can call from your Dangerfile
|
|
48
57
|
# @param [String] xcodeproj_path
|
|
49
58
|
# The path to your Xcode project
|
|
@@ -95,6 +104,7 @@ module Danger
|
|
|
95
104
|
checker.report_above_maximum = report_above_maximum
|
|
96
105
|
checker.report_pre_releases = report_pre_releases
|
|
97
106
|
checker.ignore_repos = Array(ignore_repos)
|
|
107
|
+
checker.allow_hosts = Array(allow_hosts)
|
|
98
108
|
end
|
|
99
109
|
|
|
100
110
|
def emit_checker_warnings(result)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: danger-spm_version_updates
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Harold Martin
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 3.0
|
|
32
|
+
version: 3.1.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 3.0
|
|
39
|
+
version: 3.1.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: xcodeproj
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|