forked from ROCm/rocm-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 2.17 KB
/
multiple_pr_import.yml
File metadata and controls
68 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Import Multiple Subrepo PRs
on:
workflow_dispatch:
inputs:
subrepo-prefix:
description: "Super‐repo path prefix (e.g., projects/rocblas)"
required: true
subrepo-pr-numbers:
description: "Comma‐separated list of Subrepo PR numbers to import"
required: true
subrepo-repo:
description: "Full name of subrepo repo or fork (e.g., ROCm/rocBLAS or user/rocBLAS-fork)"
required: true
subrepo-upstream:
description: "Canonical subrepo repo (e.g., ROCm/rocBLAS)"
required: true
super-repo-target-branch:
description: "Target branch in the super‐repo"
required: false
default: "develop"
jobs:
import-prs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Generate GitHub App token
id: gen_token
uses: actions/create-github-app-token@v2.0.6
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout super‐repo
uses: actions/checkout@v4
with:
token: ${{ steps.gen_token.outputs.token }}
fetch-depth: 0
sparse-checkout: |
.github/scripts/import_subrepo_prs.py
${{ github.event.inputs.subrepo-prefix }}
sparse-checkout-cone-mode: true
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub GitPython
- name: Import Subrepo PRs
env:
GITHUB_TOKEN: ${{ steps.gen_token.outputs.token }}
SUBPREFIX: ${{ github.event.inputs.subrepo-prefix }}
SUBREPO: ${{ github.event.inputs.subrepo-repo }}
UPSTREAM: ${{ github.event.inputs.subrepo-upstream }}
TARGET: ${{ github.event.inputs.super-repo-target-branch }}
PR_LIST: ${{ github.event.inputs.subrepo-pr-numbers }}
run: |
python .github/scripts/import_subrepo_prs.py