Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb9e058

Browse files
authored
Add workflow to automate bundling dependabot PRs (#2997)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
1 parentac0221e commiteb9e058

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name:dependabot-pr
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-pr:
8+
runs-on:ubuntu-latest
9+
steps:
10+
-uses:actions/checkout@v3
11+
12+
-name:Install zsh
13+
run:sudo apt-get update; sudo apt-get install zsh
14+
15+
-name:Run dependabot-pr.sh
16+
run:./.github/workflows/scripts/dependabot-pr.sh
17+
env:
18+
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/zsh -ex
2+
3+
# Copyright The OpenTelemetry Authors
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
git config user.name$GITHUB_ACTOR
18+
git config user.email$GITHUB_ACTOR@users.noreply.github.com
19+
20+
PR_NAME=dependabot-prs/`date +'%Y-%m-%dT%H%M%S'`
21+
git checkout -b$PR_NAME
22+
23+
IFS=$'\n'
24+
requests=($(gh pr list --search"author:app/dependabot" --json number,title --template'{{range .}}{{tablerow .title}}{{end}}'))
25+
message=""
26+
dirs=(`find. -type f -name"go.mod" -exec dirname {}\;| sort| egrep'^./'`)
27+
28+
declare -A mods
29+
30+
forlinein$requests;do
31+
echo$line
32+
if [[$line!= Bump* ]];then
33+
continue
34+
fi
35+
36+
module=$(echo$line| cut -f 2 -d"")
37+
if [[$module== go.opentelemetry.io/otel* ]];then
38+
continue
39+
fi
40+
version=$(echo$line| cut -f 6 -d"")
41+
42+
mods[$module]=$version
43+
message+=$line
44+
message+=$'\n'
45+
done
46+
47+
formodule versionin${(kv)mods};do
48+
topdir=`pwd`
49+
fordirin$dirs;do
50+
echo"checking$dir"
51+
cd$dir&&if grep -q"$module" go.mod;then go get"$module"@v"$version";fi
52+
cd$topdir
53+
done
54+
done
55+
56+
make go-mod-tidy
57+
make build
58+
59+
git add go.sum go.mod
60+
git add"**/go.sum""**/go.mod"
61+
git commit -m"dependabot updates`date`
62+
$message"
63+
git push origin$PR_NAME
64+
65+
gh pr create --title"dependabot updates`date`" --body"$message" -l"Skip Changelog"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp