ci: backport (#1034)

* ci: add sync/backport action

* chore: and delete that too
This commit is contained in:
lea
2024-04-01 23:20:46 -07:00
committed by GitHub
parent 2a20771945
commit 96bfec2357
3 changed files with 33 additions and 38 deletions
+8
View File
@@ -0,0 +1,8 @@
{
"repoOwner": "terrapkg",
"repoName": "packages",
"targetBranchChoices": ["f38", "f39", "f40", "frawhide"],
"branchLabelMapping": {
"^sync-(.+)$": "$1"
}
}
+25
View File
@@ -0,0 +1,25 @@
name: Automatic backport/sync action
on:
pull_request_target:
types: ["labeled", "closed"]
jobs:
backport:
name: Backport/sync PR
runs-on: ubuntu-latest
steps:
- name: Backport Action
uses: sorenlouv/backport-github-action@v9.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
auto_backport_label_prefix: sync-
- name: Info log
if: ${{ success() }}
run: cat ~/.backport/backport.info.log
- name: Debug log
if: ${{ failure() }}
run: cat ~/.backport/backport.debug.log
-38
View File
@@ -1,38 +0,0 @@
name: Sync PR to other branches
on:
pull_request:
types:
- closed
branches:
- f38
jobs:
sync:
strategy:
matrix:
branch: ["f37"]
fail-fast: false
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'nosync')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }}
ref: ${{ matrix.branch }}
- name: Install SSH key and Setup Git
run: |
mkdir -p ${{ runner.temp }}
echo "${{ secrets.SSH_SIGNING_KEY }}" > ${{ runner.temp }}/signing_key
chmod 0700 ${{ runner.temp }}/signing_key
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config user.name "Raboneko"
git config user.email "raboneko@fyralabs.com"
git config gpg.format "ssh"
git config user.signingkey "${{ runner.temp }}/signing_key"
- name: Apply patches and Push
run: |
curl https://github.com/terrapkg/packages/pull/${{ github.event.pull_request.number }}.patch > pr.patch
git am -S --keep-cr --signoff < pr.patch
git push -u origin --all