octokit 7.0.0 → 7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 398b3f7b1ccfb89b207c3bb654fe34617a4fade1e86b1d9bd7909180b702bc38
4
- data.tar.gz: c00f669f44e74b19861c4bd86042aa67e05f272a64021c406aa8a4d6884ad0fd
3
+ metadata.gz: 27b858e49de1997cc637b78dd77f283f49164e16783d58b665e55da23a2fe957
4
+ data.tar.gz: f2447bb4e8e8a15e45eb43ebf771a4a04d2fbb9f1615ef9cd835347bb289f33f
5
5
  SHA512:
6
- metadata.gz: 7d9034260fe94ee7fd55e117457592c36d34777d49ab3efe2ad526c6551e3a2a18a4f4ac1c17df88af53436115f3d6435128bbde1701f48c6647acfb9a396fbd
7
- data.tar.gz: 0151f0ec5966df0bb940fe979cf73c1c646aed1f1ff75b050a3e39890c706aa078ef64ae7e5c6efa56f010c78f050913390346d8a2511946bbe731c7dcadb1bb
6
+ metadata.gz: 6e616a14ccdeba68b690f0d3956a6e8eaf45963615231c9c2d95bbef41d3da5bba70401aff57676bdcefcd9d49095cf19932c1383cd8c5d8bb9f54d246f5a48d
7
+ data.tar.gz: afeaa8ff5a087af75af032b14ffb7428614bd76827fd987a35f36614601ed62d2592961ef09327357ec7b1378ca6b214ef251daa5be5afab5bee5e1c8656fd1f
@@ -54,6 +54,59 @@ module Octokit
54
54
  def delete_actions_secret(repo, name)
55
55
  boolean_from_response :delete, "#{Repository.path repo}/actions/secrets/#{name}"
56
56
  end
57
+
58
+ # Get environment public key for secrets encryption
59
+ #
60
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
61
+ # @param environment [String] Name of environment
62
+ # @return [Hash] key_id and key
63
+ # @see https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key
64
+ def get_actions_environment_public_key(repo, environment)
65
+ get "#{Repository.path repo}/environments/#{environment}/secrets/public-key"
66
+ end
67
+
68
+ # List environment secrets
69
+ #
70
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
71
+ # @param environment [String] Name of environment
72
+ # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at)
73
+ # @see https://developer.github.com/v3/actions/secrets/#list-environment-secrets
74
+ def list_actions_environment_secrets(repo, environment)
75
+ paginate "#{Repository.path repo}/environments/#{environment}/secrets" do |data, last_response|
76
+ data.secrets.concat last_response.data.secrets
77
+ end
78
+ end
79
+
80
+ # Get an environment secret
81
+ #
82
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
83
+ # @param environment [String] Name of environment
84
+ # @param name [String] Name of secret
85
+ # @return [Hash] name, created_at and updated_at
86
+ # @see https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret
87
+ def get_actions_environment_secret(repo, environment, name)
88
+ get "#{Repository.path repo}/environments/#{environment}/secrets/#{name}"
89
+ end
90
+
91
+ # Create or update an environment secret
92
+ #
93
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
94
+ # @param environment [String] Name of environment
95
+ # @param name [String] Name of secret
96
+ # @param options [Hash] encrypted_value and key_id
97
+ # @see https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret
98
+ def create_or_update_actions_environment_secret(repo, environment, name, options)
99
+ put "#{Repository.path repo}/environments/#{environment}/secrets/#{name}", options
100
+ end
101
+
102
+ # Delete environment secret
103
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
104
+ # @param environment [String] Name of environment
105
+ # @param name [String] Name of secret
106
+ # @see https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret
107
+ def delete_actions_environment_secret(repo, environment, name)
108
+ boolean_from_response :delete, "#{Repository.path repo}/environments/#{environment}/secrets/#{name}"
109
+ end
57
110
  end
58
111
  end
59
112
  end
@@ -48,7 +48,8 @@ module Octokit
48
48
  # @return [String] Repository API path
49
49
  def path
50
50
  return named_api_path if @owner && @name
51
- return id_api_path if @id
51
+
52
+ id_api_path if @id
52
53
  end
53
54
 
54
55
  # Get the api path for a repo
@@ -7,7 +7,7 @@ module Octokit
7
7
 
8
8
  # Current minor release.
9
9
  # @return [Integer]
10
- MINOR = 0
10
+ MINOR = 1
11
11
 
12
12
  # Current patch level.
13
13
  # @return [Integer]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wynn Netherland
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-07-28 00:00:00.000000000 Z
13
+ date: 2023-08-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday