Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
0a36cbdd
Unverified
Commit
0a36cbdd
authored
2 years ago
by
Aleksandr Lesnenko
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
automerge backported prs (#24219)
parent
1de4c4a4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/auto-backport.yml
+21
-5
21 additions, 5 deletions
.github/workflows/auto-backport.yml
.github/workflows/backport.yml
+21
-4
21 additions, 4 deletions
.github/workflows/backport.yml
with
42 additions
and
9 deletions
.github/workflows/auto-backport.yml
+
21
−
5
View file @
0a36cbdd
...
...
@@ -11,13 +11,11 @@ jobs:
-
uses
:
actions/checkout@v3
with
:
fetch-depth
:
0
-
uses
:
tibdex/github-app-token@v1
-
uses
:
tibdex/github-app-token@v1.6.0
id
:
generate-token
with
:
app_id
:
${{ secrets.METABASE_BOT_APP_ID }}
private_key
:
${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
-
uses
:
./.github/actions/find-squashed-commit
name
:
Find commit
id
:
find_commit
...
...
@@ -30,6 +28,7 @@ jobs:
id
:
get_latest_release_branch
-
id
:
create_backport_pull_request
name
:
Create backport pull request
run
:
|
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
...
...
@@ -53,9 +52,13 @@ jobs:
git checkout master
git push -u origin ${BACKPORT_BRANCH}
hub pull-request -b "${TARGET_BRANCH}" -h "${BACKPORT_BRANCH}" -l "auto-backported" -a "${GITHUB_ACTOR}" -F- <<<"🤖 backported \"${ORIGINAL_TITLE}\"
BACKPORT_PR_URL=$(hub pull-request -b "${TARGET_BRANCH}" -h "${BACKPORT_BRANCH}" -l "auto-backported,automerge" -a "${GITHUB_ACTOR}" -F- <<<"🤖 backported \"${ORIGINAL_TITLE}\"
#${ORIGINAL_PULL_REQUEST_NUMBER}")
BACKPORT_PR_NUMBER=${BACKPORT_PR_URL##*/}
#${ORIGINAL_PULL_REQUEST
_NUMBER
}
"
echo "::set-output name=backport_pr_number::$BACKPORT_PR
_NUMBER"
env
:
TARGET_BRANCH
:
${{ steps.get_latest_release_branch.outputs.branch-name }}
ORIGINAL_PULL_REQUEST_NUMBER
:
${{ github.event.pull_request.number }}
...
...
@@ -63,6 +66,19 @@ jobs:
GITHUB_TOKEN
:
${{ steps.generate-token.outputs.token }}
COMMIT
:
${{ steps.find_commit.outputs.commit }}
-
name
:
Auto approve backport PR
uses
:
juliangruber/approve-pull-request-action@v1
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
number
:
${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
-
name
:
Enable Pull Request Automerge
uses
:
peter-evans/enable-pull-request-automerge@v2
with
:
token
:
${{ steps.generate-token.outputs.token }}
pull-request-number
:
${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
merge-method
:
squash
-
uses
:
./.github/actions/notify-pull-request
if
:
${{ steps.create_backport_pull_request.outputs.has-conflicts == 'true' }}
with
:
...
...
This diff is collapsed.
Click to expand it.
.github/workflows/backport.yml
+
21
−
4
View file @
0a36cbdd
...
...
@@ -23,7 +23,7 @@ jobs:
echo User ${{ github.event.comment.user.login }} is not a member of Metabase organization
exit 1
fi
-
uses
:
tibdex/github-app-token@v1
-
uses
:
tibdex/github-app-token@v1
.6.0
id
:
generate-token
with
:
app_id
:
${{ secrets.METABASE_BOT_APP_ID }}
...
...
@@ -84,7 +84,9 @@ jobs:
name
:
Cherry-pick commits and create PR
with
:
fetch-depth
:
0
-
run
:
|
-
id
:
create_backport_pull_request
name
:
Create backport pull request
run
:
|
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
...
...
@@ -109,9 +111,13 @@ jobs:
if [[ $(hub pr list -b "${TARGET_BRANCH}" -h "${BACKPORT_BRANCH}" -s "open") ]]; then
echo "PR already exists"
else
hub pull-request -b "${TARGET_BRANCH}" -h "${BACKPORT_BRANCH}" -l "auto-backported" -a "${GITHUB_ACTOR}" -F- <<<"🤖 backported \"${ORIGINAL_TITLE}\"
BACKPORT_PR_URL=$(hub pull-request -b "${TARGET_BRANCH}" -h "${BACKPORT_BRANCH}" -l "auto-backported" -a "${GITHUB_ACTOR}" -F- <<<"🤖 backported \"${ORIGINAL_TITLE}\"
#${ORIGINAL_PULL_REQUEST_NUMBER}")
BACKPORT_PR_NUMBER=${BACKPORT_PR_URL##*/}
#${ORIGINAL_PULL_REQUEST
_NUMBER
}
"
echo "::set-output name=backport_pr_number::$BACKPORT_PR
_NUMBER"
echo "New PR has been created"
fi
env
:
...
...
@@ -126,6 +132,17 @@ jobs:
START_SHA
:
${{ fromJson(steps.branch_info.outputs.result).startSha }}
END_SHA
:
${{ fromJson(steps.branch_info.outputs.result).endSha }}
GITHUB_TOKEN
:
${{ steps.generate-token.outputs.token }}
-
name
:
Auto approve backport PR
uses
:
juliangruber/approve-pull-request-action@v1
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
number
:
${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
-
name
:
Enable Pull Request Automerge
uses
:
peter-evans/enable-pull-request-automerge@v2
with
:
token
:
${{ steps.generate-token.outputs.token }}
pull-request-number
:
${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
merge-method
:
squash
notify_when_failed
:
runs-on
:
ubuntu-20.04
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment