File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Docker Library
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - ' beta/**'
8+ - ' stable/**'
9+
10+ jobs :
11+ publish-library :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
15+ - name : Set up Dart
16+ uses : dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
17+ - name : Install dependencies
18+ run : dart pub get
19+ working-directory : scripts
20+ - name : Generate library file
21+ id : generate
22+ run : |
23+ dart scripts/bin/generate_library.dart > dart
24+ echo "library_path=dart" >> $GITHUB_OUTPUT
25+ - name : Create Pull Request
26+ env :
27+ GH_TOKEN : ${{ secrets.PUBLISH_LIBRARY_TOKEN }}
28+ run : |
29+ set -x
30+ git config --global user.name "dart-github-bot"
31+ git config --global user.email "[email protected] " 32+
33+ gh repo fork docker-library/official-images --clone=true --remote
34+ cd official-images
35+
36+ git fetch upstream
37+
38+ git checkout -B dart-library-update upstream/master
39+
40+ cp ../${{ steps.generate.outputs.library_path }} library/dart
41+
42+ git add library/dart
43+ git commit -m "Update dart"
44+
45+ git push --force --set-upstream origin dart-library-update
46+
47+ if ! gh pr list --repo docker-library/official-images --head "dart-github-bot:dart-library-update" --json number | grep -q number; then
48+ BODY=$(cat <<EOF
49+ This is an automated PR to update the Dart Docker library.
50+
51+ cc @iinozemtsev @athom
52+ EOF
53+ )
54+ gh pr create \
55+ --title "Update dart" \
56+ --body "$BODY" \
57+ --repo docker-library/official-images \
58+ --base master \
59+ --head "dart-github-bot:dart-library-update"
60+ fi
You can’t perform that action at this time.
0 commit comments