Skip to content

Commit 264e4b2

Browse files
Backport to branch(3.12) : Use reusable Auto-PR action (#2201)
Co-authored-by: Vincent Guilpain <[email protected]>
1 parent 3da73c6 commit 264e4b2

File tree

5 files changed

+4
-207
lines changed

5 files changed

+4
-207
lines changed

.github/workflows/auto-pr.yaml

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,10 @@ on:
99
types:
1010
- closed
1111

12-
env:
13-
TERM: dumb
1412
jobs:
1513
if_merged:
16-
if: github.event.pull_request.merged == true
17-
runs-on: ubuntu-latest
18-
env:
19-
GH_TOKEN: ${{ secrets.GH_PR_PAT }}
20-
# Escape the PR title. See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable for details
21-
PR_TITLE: ${{ github.event.pull_request.title }}
22-
steps:
23-
- uses: actions/checkout@v4
24-
with:
25-
# This is necessary to avoid unexpected auto-merge in git cherry-pick
26-
fetch-depth: 0
27-
# This is necessary for git-push
28-
token: ${{ secrets.GH_PR_PAT }}
29-
30-
- name: Create pull requests
31-
run: |
32-
assignee=$(ci/auto-pr/fetch_gh_user_info "${{ github.event.repository.owner.login }}" "${{ github.event.repository.name }}" "${{ github.event.pull_request.user.login }}")
33-
echo -------------
34-
echo "assignee: $assignee"
35-
echo -------------
36-
if [[ -z $assignee ]]; then
37-
# For instance, we can't assign `debendabot` to a new PR.
38-
new_pr_assignee="${{ github.event.pull_request.merged_by.login }}"
39-
else
40-
new_pr_assignee="${{ github.event.pull_request.user.login }}"
41-
fi
42-
43-
versions=$(ci/auto-pr/fetch_gh_proj_versions "${{ github.event.repository.owner.login }}" "${{ github.event.repository.name }}" "${{ github.event.number }}")
44-
echo -------------
45-
echo "versions: $versions"
46-
echo -------------
47-
48-
branches=$(ci/auto-pr/conv_proj_version_to_branch $versions)
49-
# Remove the base branch from the list because the target change is already merged to the branch.
50-
branches=$(echo "$branches" | sed "/^${{ github.base_ref }}$/d")
51-
echo -------------
52-
echo "branches: $branches"
53-
echo -------------
54-
55-
ci/auto-pr/create_pull_requests \
56-
"${{ github.event.number }}" \
57-
"${{ github.event.pull_request.html_url }}" \
58-
"$PR_TITLE" \
59-
"${{ github.sha }}" \
60-
"$new_pr_assignee" \
61-
$branches
14+
uses: scalar-labs/actions/.github/workflows/auto-pr-reusable.yaml@main
15+
secrets: inherit
16+
with:
17+
project_base_name: "ScalarDB"
6218

ci/auto-pr/conv_proj_version_to_branch

Lines changed: 0 additions & 33 deletions
This file was deleted.

ci/auto-pr/create_pull_requests

Lines changed: 0 additions & 66 deletions
This file was deleted.

ci/auto-pr/fetch_gh_proj_versions

Lines changed: 0 additions & 30 deletions
This file was deleted.

ci/auto-pr/fetch_gh_user_info

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)