You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/09/21 08:58:37 UTC

[logging-parent] branch main updated: Update the PR branch instead of the target one

This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git


The following commit(s) were added to refs/heads/main by this push:
     new c74f571  Update the PR branch instead of the target one
c74f571 is described below

commit c74f57184e5102f29696a40dab0dd098bf1e6dfc
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Thu Sep 21 10:58:55 2023 +0200

    Update the PR branch instead of the target one
    
    Trying to update the target branch fails due to the missing GPG
    key necessary for `git commit -S`. We used to do the following
    
    1. checkout target branch
    2. apply dependabot's changes
    3. add changelog entry
    4. run ./mvnw process-sources`
    5. `git add . && git commit -S -a`
    6. close the dependabot PR
    
    This commit switches to the following instead:
    
    1. checkout target branch
    2. add changelog entry
    3. run ``./mvnw process-sources`
    4. `git add . && git commit -a` (notice the absence of `S`!)
    5. `gh pr merge --auto --squash`
---
 .github/workflows/build-reusable.yaml | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/build-reusable.yaml b/.github/workflows/build-reusable.yaml
index d7bfe99..00ca0cd 100644
--- a/.github/workflows/build-reusable.yaml
+++ b/.github/workflows/build-reusable.yaml
@@ -96,22 +96,7 @@ jobs:
           DEPENDENCY_NAMES: ${{ steps.dependabot-metadata.outputs.dependency-names }}
           DEPENDENCY_VERSION: ${{ steps.dependabot-metadata.outputs.new-version }}
 
-      - name: Download patch
-        shell: bash
-        run: wget "$PATCH_URL" -O /tmp/patch
-        env:
-          PATCH_URL: ${{ github.event.pull_request.patch_url }}
-
-      - name: Checkout repository
-        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744   # 3.6.0
-        with:
-          ref: ${{ steps.dependabot-metadata.outputs.target-branch }}
-
-      - name: Apply patch
-        shell: bash
-        run: git apply /tmp/patch
-
-      - name: Set up Java & GPG
+      - name: Set up Java
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2   # 3.7.0
         with:
           distribution: temurin
@@ -164,13 +149,13 @@ jobs:
         run: |
           git add .
           git status
-          git config user.name dependabot
-          git config user.email dependabot@github.com
-          git commit -S -a -m "Update \`$DEPENDENCY_NAME\` to version \`$DEPENDENCY_VERSION\`"
+          git config user.name github-actions
+          git config user.email github-actions@github.com
+          git commit -a -m "Update \`$DEPENDENCY_NAME\` to version \`$DEPENDENCY_VERSION\`"
           git push origin
 
-      - name: Close the PR
-        run: gh pr close "$PR_URL"
+      - name: Merge the PR
+        run: gh pr merge --auto --squash "$PR_URL"
         env:
           PR_URL: ${{ github.event.pull_request.html_url }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}