sashimi_tanpopo 0.4.0 → 0.5.1
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/CHANGELOG.md +14 -2
- data/Dockerfile +1 -1
- data/README.md +25 -23
- data/lib/sashimi_tanpopo/cli.rb +40 -38
- data/lib/sashimi_tanpopo/provider/github.rb +5 -1
- data/lib/sashimi_tanpopo/version.rb +1 -1
- data/rbs_collection.lock.yaml +4 -0
- data/sig/sashimi_tanpopo/provider/github.rbs +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eec038a208e1f4e8e328c1e4c2529d901f8e3d00b9ecd9247c77bc885226e7eb
|
|
4
|
+
data.tar.gz: 4500f065e44766e0345f5d90a4eed6a3681f4546b8c5e471b0c968f7ed8a4244
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3a5fd30ea0aec1f3494b24dd50d4c5ae171a45d0453cda41f9733b6d3aa2572629a935780f034bdf33bc9420b46d2bf825fb2543c2f1fa182df33e63ebe7873
|
|
7
|
+
data.tar.gz: 8d55ed6fe29bf86ac87ca25b90f64487fec202337c4f0e66b44a861a62d74d7ddc9dafb61cd79e90e04ad10d2b14ec2e528f513c3dbbbb509c9b7deef4c1c870
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
|
-
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.
|
|
2
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.1...main)
|
|
3
3
|
|
|
4
|
-
## [v0.
|
|
4
|
+
## [v0.5.1](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.5.1) - 2025-12-07
|
|
5
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.0...v0.5.1)
|
|
6
|
+
|
|
7
|
+
* Fixes Docker image was not pushed to ghcr.io
|
|
8
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/86
|
|
9
|
+
|
|
10
|
+
## [v0.5.0](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.5.0) - 2025-12-07
|
|
11
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.4.0...v0.5.0)
|
|
12
|
+
|
|
13
|
+
* Add `--only-changes-summary` to `sashimi_tanpopo github`
|
|
14
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/84
|
|
15
|
+
|
|
16
|
+
## [v0.4.0](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.4.0) - 2025-12-03
|
|
5
17
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.4...v0.4.0)
|
|
6
18
|
|
|
7
19
|
* Add `create` arg to `update_file`
|
data/Dockerfile
CHANGED
data/README.md
CHANGED
|
@@ -81,29 +81,31 @@ Usage:
|
|
|
81
81
|
sashimi_tanpopo github RECIPE [RECIPE...] --pr-source-branch=pr_branch --pr-title=PR_TITLE -m, --message=COMMIT_MESSAGE
|
|
82
82
|
|
|
83
83
|
Options:
|
|
84
|
-
-d, [--target-dir=TARGET_DIR]
|
|
85
|
-
-p, [--params=key:value]
|
|
86
|
-
[--dry-run], [--no-dry-run], [--skip-dry-run]
|
|
87
|
-
|
|
88
|
-
[--color], [--no-color], [--skip-color]
|
|
89
|
-
|
|
90
|
-
[--git-user-name=GIT_USER_NAME]
|
|
91
|
-
[--git-email=GIT_EMAIL]
|
|
92
|
-
-m, --message=COMMIT_MESSAGE
|
|
93
|
-
[--github-repository=user/repo]
|
|
94
|
-
[--github-api-url=GITHUB_API_URL]
|
|
95
|
-
|
|
96
|
-
[--github-token=GITHUB_TOKEN]
|
|
97
|
-
[--github-step-summary=GITHUB_STEP_SUMMARY]
|
|
98
|
-
--
|
|
99
|
-
|
|
100
|
-
--pr-
|
|
101
|
-
[--pr-
|
|
102
|
-
|
|
103
|
-
[--pr-
|
|
104
|
-
[--pr-
|
|
105
|
-
[--pr-
|
|
106
|
-
|
|
84
|
+
-d, [--target-dir=TARGET_DIR] # Target directory. Default: current directory
|
|
85
|
+
-p, [--params=key:value] # Params passed to recipe file
|
|
86
|
+
[--dry-run], [--no-dry-run], [--skip-dry-run] # Whether to run dry run
|
|
87
|
+
# Default: false
|
|
88
|
+
[--color], [--no-color], [--skip-color] # Whether to colorize output
|
|
89
|
+
# Default: true
|
|
90
|
+
[--git-user-name=GIT_USER_NAME] # user name for git commit. Default: username of user authenticated with token
|
|
91
|
+
[--git-email=GIT_EMAIL] # email for git commit. Default: <git_user_name>@users.noreply.<github_host>
|
|
92
|
+
-m, --message=COMMIT_MESSAGE # commit message
|
|
93
|
+
[--github-repository=user/repo] # GitHub repository for Pull Request. One of --github--repository or $GITHUB_REPOSITORY is required [$GITHUB_REPOSITORY]
|
|
94
|
+
[--github-api-url=GITHUB_API_URL] # GitHub API endpoint. One of --github-api-url or $GITHUB_API_URL is required [$GITHUB_API_URL]
|
|
95
|
+
# Default: https://api.github.com
|
|
96
|
+
[--github-token=GITHUB_TOKEN] # GitHub access token. One of --github-token or $GITHUB_TOKEN is required [$GITHUB_TOKEN]
|
|
97
|
+
[--github-step-summary=GITHUB_STEP_SUMMARY] # Path to GitHub step summary file [$GITHUB_STEP_SUMMARY]
|
|
98
|
+
[--only-changes-summary], [--no-only-changes-summary], [--skip-only-changes-summary] # Whether to write only file changes to step summary file
|
|
99
|
+
# Default: false
|
|
100
|
+
--pr-title=PR_TITLE # Pull Request title
|
|
101
|
+
[--pr-body=PR_BODY] # Pull Request body
|
|
102
|
+
--pr-source-branch=pr_branch # Pull Request source branch (a.k.a. head branch)
|
|
103
|
+
[--pr-target-branch=main] # Pull Request target branch (a.k.a. base branch). Default: default branch of repository (e.g. main, master)
|
|
104
|
+
[--pr-assignees=one two three] # Pull Request assignees
|
|
105
|
+
[--pr-reviewers=one two three] # Pull Request reviewers
|
|
106
|
+
[--pr-labels=one two three] # Pull Request labels
|
|
107
|
+
[--pr-draft], [--no-pr-draft], [--skip-pr-draft] # Whether to create draft Pull Request
|
|
108
|
+
# Default: false
|
|
107
109
|
```
|
|
108
110
|
|
|
109
111
|
`--github-token` requires followings repository permissions
|
data/lib/sashimi_tanpopo/cli.rb
CHANGED
|
@@ -35,49 +35,51 @@ module SashimiTanpopo
|
|
|
35
35
|
|
|
36
36
|
desc "github RECIPE [RECIPE...]", "Change local files using recipe files and create Pull Request"
|
|
37
37
|
define_exec_common_options
|
|
38
|
-
option :git_user_name,
|
|
39
|
-
option :git_email,
|
|
40
|
-
option :message,
|
|
41
|
-
option :github_repository,
|
|
42
|
-
option :github_api_url,
|
|
43
|
-
option :github_token,
|
|
44
|
-
option :github_step_summary,
|
|
45
|
-
option :
|
|
46
|
-
option :
|
|
47
|
-
option :
|
|
48
|
-
option :
|
|
49
|
-
option :
|
|
50
|
-
option :
|
|
51
|
-
option :
|
|
52
|
-
option :
|
|
38
|
+
option :git_user_name, type: :string, desc: "user name for git commit. Default: username of user authenticated with token"
|
|
39
|
+
option :git_email, type: :string, desc: "email for git commit. Default: <git_user_name>@users.noreply.<github_host>"
|
|
40
|
+
option :message, type: :string, desc: "commit message", required: true, aliases: "-m", banner: "COMMIT_MESSAGE"
|
|
41
|
+
option :github_repository, type: :string, desc: "GitHub repository for Pull Request. One of --github--repository or $GITHUB_REPOSITORY is required [$GITHUB_REPOSITORY]", banner: "user/repo"
|
|
42
|
+
option :github_api_url, type: :string, desc: "GitHub API endpoint. One of --github-api-url or $GITHUB_API_URL is required [$GITHUB_API_URL]", default: "https://api.github.com"
|
|
43
|
+
option :github_token, type: :string, desc: "GitHub access token. One of --github-token or $GITHUB_TOKEN is required [$GITHUB_TOKEN]"
|
|
44
|
+
option :github_step_summary, type: :string, desc: "Path to GitHub step summary file [$GITHUB_STEP_SUMMARY]"
|
|
45
|
+
option :only_changes_summary, type: :boolean, desc: "Whether to write only file changes to step summary file", default: false
|
|
46
|
+
option :pr_title, type: :string, desc: "Pull Request title", required: true
|
|
47
|
+
option :pr_body, type: :string, desc: "Pull Request body"
|
|
48
|
+
option :pr_source_branch, type: :string, desc: "Pull Request source branch (a.k.a. head branch)", required: true, banner: "pr_branch"
|
|
49
|
+
option :pr_target_branch, type: :string, desc: "Pull Request target branch (a.k.a. base branch). Default: default branch of repository (e.g. main, master)", banner: "main"
|
|
50
|
+
option :pr_assignees, type: :array, desc: "Pull Request assignees", default: []
|
|
51
|
+
option :pr_reviewers, type: :array, desc: "Pull Request reviewers", default: []
|
|
52
|
+
option :pr_labels, type: :array, desc: "Pull Request labels", default: []
|
|
53
|
+
option :pr_draft, type: :boolean, desc: "Whether to create draft Pull Request", default: false
|
|
53
54
|
def github(*recipe_files)
|
|
54
|
-
repository
|
|
55
|
-
api_endpoint
|
|
56
|
-
access_token
|
|
55
|
+
repository = option_or_env!(option_name: :github_repository, env_name: "GITHUB_REPOSITORY")
|
|
56
|
+
api_endpoint = option_or_env!(option_name: :github_api_url, env_name: "GITHUB_API_URL")
|
|
57
|
+
access_token = option_or_env!(option_name: :github_token, env_name: "GITHUB_TOKEN")
|
|
57
58
|
|
|
58
59
|
summary_path = option_or_env(option_name: :github_step_summary, env_name: "GITHUB_STEP_SUMMARY")
|
|
59
60
|
|
|
60
61
|
Provider::GitHub.new(
|
|
61
|
-
recipe_paths:
|
|
62
|
-
target_dir:
|
|
63
|
-
params:
|
|
64
|
-
dry_run:
|
|
65
|
-
is_colored:
|
|
66
|
-
git_username:
|
|
67
|
-
git_email:
|
|
68
|
-
commit_message:
|
|
69
|
-
repository:
|
|
70
|
-
api_endpoint:
|
|
71
|
-
access_token:
|
|
72
|
-
pr_title:
|
|
73
|
-
pr_body:
|
|
74
|
-
pr_source_branch:
|
|
75
|
-
pr_target_branch:
|
|
76
|
-
pr_assignees:
|
|
77
|
-
pr_reviewers:
|
|
78
|
-
pr_labels:
|
|
79
|
-
is_draft_pr:
|
|
80
|
-
summary_path:
|
|
62
|
+
recipe_paths: recipe_files,
|
|
63
|
+
target_dir: options[:target_dir],
|
|
64
|
+
params: self.class.normalize_params(options[:params]),
|
|
65
|
+
dry_run: options[:dry_run],
|
|
66
|
+
is_colored: options[:color],
|
|
67
|
+
git_username: options[:git_user_name],
|
|
68
|
+
git_email: options[:git_email],
|
|
69
|
+
commit_message: options[:message],
|
|
70
|
+
repository: repository,
|
|
71
|
+
api_endpoint: api_endpoint,
|
|
72
|
+
access_token: access_token,
|
|
73
|
+
pr_title: options[:pr_title],
|
|
74
|
+
pr_body: options[:pr_body],
|
|
75
|
+
pr_source_branch: options[:pr_source_branch],
|
|
76
|
+
pr_target_branch: options[:pr_target_branch],
|
|
77
|
+
pr_assignees: options[:pr_assignees],
|
|
78
|
+
pr_reviewers: options[:pr_reviewers],
|
|
79
|
+
pr_labels: options[:pr_labels],
|
|
80
|
+
is_draft_pr: options[:pr_draft],
|
|
81
|
+
summary_path: summary_path,
|
|
82
|
+
only_changes_summary: options[:only_changes_summary],
|
|
81
83
|
).perform
|
|
82
84
|
end
|
|
83
85
|
|
|
@@ -28,12 +28,13 @@ module SashimiTanpopo
|
|
|
28
28
|
# @param pr_labels [Array<String>]
|
|
29
29
|
# @param is_draft_pr [Boolean] Whether create draft Pull Request
|
|
30
30
|
# @param summary_path [String,nil]
|
|
31
|
+
# @param only_changes_summary [Boolean]
|
|
31
32
|
def initialize(recipe_paths:, target_dir:, params:, dry_run:, is_colored:,
|
|
32
33
|
git_username:, git_email:, commit_message:,
|
|
33
34
|
repository:, access_token:, api_endpoint: DEFAULT_API_ENDPOINT,
|
|
34
35
|
pr_title:, pr_body:, pr_source_branch:, pr_target_branch:,
|
|
35
36
|
pr_assignees: [], pr_reviewers: [], pr_labels: [], is_draft_pr:,
|
|
36
|
-
summary_path:)
|
|
37
|
+
summary_path:, only_changes_summary:)
|
|
37
38
|
super(
|
|
38
39
|
recipe_paths: recipe_paths,
|
|
39
40
|
target_dir: target_dir,
|
|
@@ -57,6 +58,7 @@ module SashimiTanpopo
|
|
|
57
58
|
@git_email = git_email
|
|
58
59
|
@api_endpoint = api_endpoint
|
|
59
60
|
@summary_path = summary_path || ""
|
|
61
|
+
@only_changes_summary = only_changes_summary
|
|
60
62
|
|
|
61
63
|
@client = Octokit::Client.new(api_endpoint: api_endpoint, access_token: access_token)
|
|
62
64
|
end
|
|
@@ -168,6 +170,8 @@ module SashimiTanpopo
|
|
|
168
170
|
def write_summary_file(changed_files)
|
|
169
171
|
return if @summary_path.empty?
|
|
170
172
|
|
|
173
|
+
return if changed_files.empty? && @only_changes_summary
|
|
174
|
+
|
|
171
175
|
summary = self.class.generate_summary(changed_files: changed_files, dry_run: @dry_run)
|
|
172
176
|
|
|
173
177
|
File.open(@summary_path, "a") do |f|
|
data/rbs_collection.lock.yaml
CHANGED
|
@@ -19,6 +19,7 @@ module SashimiTanpopo
|
|
|
19
19
|
@is_draft_pr: bool
|
|
20
20
|
@api_endpoint: String
|
|
21
21
|
@summary_path: String
|
|
22
|
+
@only_changes_summary: bool
|
|
22
23
|
|
|
23
24
|
def initialize: (
|
|
24
25
|
recipe_paths: Array[String],
|
|
@@ -40,7 +41,8 @@ module SashimiTanpopo
|
|
|
40
41
|
?pr_reviewers: Array[String],
|
|
41
42
|
?pr_labels: Array[String],
|
|
42
43
|
is_draft_pr: bool,
|
|
43
|
-
summary_path: String
|
|
44
|
+
summary_path: String?,
|
|
45
|
+
only_changes_summary: bool,
|
|
44
46
|
) -> void
|
|
45
47
|
|
|
46
48
|
def perform: () -> String?
|