Skip to content

Commit 67cc3f4

Browse files
authored
Merge pull request #680 from docker/bump-llamacpp
refactor: use peter-evans/create-pull-request for bump workflow
2 parents d582f64 + e66ee5e commit 67cc3f4

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

.github/workflows/bump-llamacpp.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Bump llama.cpp
22

3+
run-name: "Bump llama.cpp${{ inputs.tag && format(' to {0}', inputs.tag) || '' }}"
4+
35
permissions:
4-
actions: write
56
contents: write
67
pull-requests: write
78

@@ -31,25 +32,28 @@ jobs:
3132
echo "$OUTPUT"
3233
if git diff --cached --quiet; then
3334
echo "changed=false" >> "$GITHUB_OUTPUT"
35+
echo "### Already up to date" >> "$GITHUB_STEP_SUMMARY"
3436
else
3537
COMMIT_MSG=$(echo "$OUTPUT" | grep -oP "(?<=-m ').*(?=')")
38+
TAG=$(echo "$COMMIT_MSG" | grep -oP '[^/]+(?=\)$)')
3639
echo "commit-msg=$COMMIT_MSG" >> "$GITHUB_OUTPUT"
40+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
3741
echo "changed=true" >> "$GITHUB_OUTPUT"
42+
echo "### $COMMIT_MSG" >> "$GITHUB_STEP_SUMMARY"
3843
fi
3944
4045
- name: Create pull request
4146
if: steps.bump.outputs.changed == 'true'
42-
env:
43-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
COMMIT_MSG: ${{ steps.bump.outputs.commit-msg }}
45-
run: |
46-
TAG=$(echo "$COMMIT_MSG" | grep -oP '[^/]+(?=\)$)')
47-
gh api -X PATCH "/repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
48-
-f name="Bump llama.cpp to $TAG"
49-
BRANCH="bump-llamacpp-$TAG"
50-
git checkout -b "$BRANCH"
51-
git commit --signoff -m "$COMMIT_MSG"
52-
git push -u origin "$BRANCH"
53-
gh pr create \
54-
--title "chore: bump llama.cpp to $TAG" \
55-
--body "Bumps llama.cpp submodule to [$TAG](https://github.com/ggml-org/llama.cpp/releases/$TAG)."
47+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
sign-commits: 'true'
51+
commit-message: ${{ steps.bump.outputs.commit-msg }}
52+
title: ${{ steps.bump.outputs.commit-msg }}
53+
body: |
54+
Bumps llama.cpp submodule.
55+
branch: bump-llamacpp-${{ steps.bump.outputs.tag }}
56+
base: main
57+
labels: dependencies
58+
delete-branch: true
59+
add-paths: llamacpp/native/vendor/llama.cpp

0 commit comments

Comments
 (0)