forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (70 loc) · 2.03 KB
/
Copy pathbackport_prepare.yaml
File metadata and controls
76 lines (70 loc) · 2.03 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
69
70
71
72
73
74
75
76
name: "Backport: Prepare"
on:
workflow_dispatch:
inputs:
issue:
description: 'The Backport Tracking Issue Number'
required: false
type: string
pr:
description: 'PR to backport (e.g. #123) (if no issue)'
required: false
type: string
from_minor:
description: 'From minor version (e.g. 1.7) (if no issue)'
required: false
type: string
to_minor:
description: 'To minor version (e.g. 1.9) (if no issue, optional)'
required: false
type: string
workflow_call:
inputs:
issue:
description: 'The Backport Tracking Issue Number'
required: false
type: string
permissions:
contents: write
issues: write
pull-requests: write
jobs:
backport_prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-version: 1.20.0
- name: Configure Git Identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Run Backport Preparation Pipeline
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ inputs.issue }}
PR: ${{ inputs.pr }}
FROM_MINOR: ${{ inputs.from_minor }}
TO_MINOR: ${{ inputs.to_minor }}
run: |
ARGS=()
if [ -n "$ISSUE" ]; then
ARGS+=("--issue=$ISSUE")
else
if [ -n "$PR" ]; then
ARGS+=("--pr=$PR")
fi
if [ -n "$FROM_MINOR" ]; then
ARGS+=("--from-minor=$FROM_MINOR")
fi
if [ -n "$TO_MINOR" ]; then
ARGS+=("--to-minor=$TO_MINOR")
fi
fi
bazel run //tools/private/release -- \
backport-prepare "${ARGS[@]}" --no-dry-run