Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/cherry-pick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Cherry Pick

on:
workflow_call:

jobs:
branches:
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.cherry_pick_branches.outputs.result }}
steps:
- name: Check for cherry-pick labels
id: cherry_pick_branches
uses: actions/github-script@v7
with:
script: |
const { data: issue } = await github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});

const labels = issue.labels.map(label => label.name);
console.log(`Labels: ${labels}`);

const branches = labels.filter(label => label.startsWith('cherry-pick/'))
.map(label => label.substr(12));
console.log(`Branches: ${branches}`);

return branches

cherry-pick:
runs-on: ubuntu-latest
needs: branches
if: ${{ needs.branches.outputs.branches != '[]' && needs.branches.outputs.branches != '' }}
strategy:
matrix:
branch: ${{ fromJson(needs.branches.outputs.branches) }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0

- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v3
with:
application_id: ${{ vars.TRUSTIFICATION_BOT_ID }}
application_private_key: ${{ secrets.TRUSTIFICATION_BOT_KEY }}

- name: Cherry-pick
env:
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
BRANCH_NAME="cherry-pick-pr${{ github.event.number }}-${{ matrix.branch }}"
git config --global user.email "noreply@github.com"
git config --global user.name "Cherry Picker"
git checkout -b ${BRANCH_NAME}
git cherry-pick -s ${{ github.sha }}
git push origin ${BRANCH_NAME}
gh pr create --base ${{ matrix.branch }} --fill
29 changes: 29 additions & 0 deletions .github/workflows/ci-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI (repo level)

on:
push:
branches:
- "main"
- "release/*"
pull_request:
branches:
- "main"
- "release/*"
workflow_dispatch:
workflow_call:

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: Swatinem/rust-cache@v2
- name: Crate Format
run: cargo fmt --check
- name: Crate Check
run: cargo check
- name: Crate Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Crate Test
run: cargo test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
.idea/
Loading
Loading