mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-20 20:14:29 +00:00
35 lines
911 B
YAML
35 lines
911 B
YAML
name: Hotfix Cherry-Pick
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [closed, labeled]
|
|
|
|
concurrency:
|
|
group: hotfix-to-main
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
cherry-pick:
|
|
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'hotfix')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout main
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
fetch-depth: 0
|
|
|
|
- name: Cherry-pick fix to main
|
|
run: |
|
|
git config user.name "Dokploy Bot"
|
|
git config user.email "[email protected]"
|
|
SHA="${{ github.event.pull_request.merge_commit_sha }}"
|
|
if [ "$(git rev-list --parents -n1 "$SHA" | wc -w)" -gt 2 ]; then
|
|
git cherry-pick -x -m 1 "$SHA"
|
|
else
|
|
git cherry-pick -x "$SHA"
|
|
fi
|
|
git push origin main
|