Skip to content

Commit 10624bf

Browse files
committed
remove newline
1 parent 29492c2 commit 10624bf

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Update Dockerfile Dependencies
22
on:
3-
# schedule:
4-
# - cron: '0 13 * * *'
5-
pull_request:
3+
schedule:
4+
- cron: '0 13 * * *'
5+
workflow_dispatch:
66

77
permissions:
88
contents: write
@@ -29,15 +29,12 @@ jobs:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
run: cd dependency_updater && ./dependency_updater --repo ../ --github-action true
3131

32-
- name: test new formatting
33-
run: echo "${{ steps.run_dependency_updater.outputs.DESC }}"
34-
35-
# - name: create pull request
36-
# if: ${{ steps.run_dependency_updater.outputs.TITLE != '' }}
37-
# uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
38-
# with:
39-
# title: ${{ steps.run_dependency_updater.outputs.TITLE }}
40-
# commit-message: ${{ steps.run_dependency_updater.outputs.TITLE }}
41-
# body: ${{ steps.run_dependency_updater.outputs.DESC }}
42-
# branch: run-dependency-updater
43-
# delete-branch: true
32+
- name: create pull request
33+
if: ${{ steps.run_dependency_updater.outputs.TITLE != '' }}
34+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
35+
with:
36+
title: ${{ steps.run_dependency_updater.outputs.TITLE }}
37+
commit-message: ${{ steps.run_dependency_updater.outputs.TITLE }}
38+
body: "${{ steps.run_dependency_updater.outputs.DESC }}"
39+
branch: run-dependency-updater
40+
delete-branch: true

dependency_updater/dependency_updater.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,18 @@ func updater(token string, repoPath string, commit bool, githubAction bool) erro
134134
func createCommitMessage(updatedDependencies []VersionUpdateInfo, repoPath string, githubAction bool) error {
135135
var repos []string
136136
commitTitle := "chore: updated "
137-
commitDescription := "Updated dependencies for: \n"
137+
commitDescription := "Updated dependencies for: "
138138

139139
for _, dependency := range updatedDependencies {
140140
repo, tag := dependency.Repo, dependency.To
141-
commitDescription += repo + " => " + tag + " (" + dependency.DiffUrl + ")\n"
141+
commitDescription += repo + " => " + tag + " (" + dependency.DiffUrl + ") "
142142
repos = append(repos, repo)
143143
}
144-
commitDescription = strings.TrimSuffix(commitDescription, "\n")
144+
commitDescription = strings.TrimSuffix(commitDescription, " ")
145145
commitTitle += strings.Join(repos, ", ")
146146

147147
if githubAction {
148-
err := createGitMessageEnv(commitTitle, commitDescription, repoPath)
148+
err := writeToGithubOutput(commitTitle, commitDescription, repoPath)
149149
if err != nil {
150150
return fmt.Errorf("error creating git commit message: %s", err)
151151
}
@@ -339,7 +339,7 @@ func createVersionsEnv(repoPath string, dependencies Dependencies) error {
339339
return nil
340340
}
341341

342-
func createGitMessageEnv(title string, description string, repoPath string) error {
342+
func writeToGithubOutput(title string, description string, repoPath string) error {
343343
file := os.Getenv("GITHUB_OUTPUT")
344344
f, err := os.OpenFile(file, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
345345
if err != nil {

0 commit comments

Comments
 (0)