forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (69 loc) · 2.21 KB
/
Copy pathrelease_process_backports.yaml
File metadata and controls
76 lines (69 loc) · 2.21 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: "Release: Process Backports"
on:
workflow_dispatch:
inputs:
issue:
description: 'The Release Tracking Issue Number (e.g., 142)'
required: true
type: string
add_backports:
description: 'CSV list of PR numbers to add and process (optional)'
required: false
type: string
comment_id:
description: 'The ID of the comment that triggered this run (optional)'
required: false
type: string
workflow_call:
inputs:
issue:
description: 'The Release Tracking Issue Number (e.g., 142)'
required: true
type: string
add_backports:
description: 'CSV list of PR numbers to add and process (optional)'
required: false
type: string
comment_id:
description: 'The ID of the comment that triggered this run (optional)'
required: false
type: string
permissions:
contents: write
issues: write
jobs:
process_backports:
# Always gate GHA runs to ensure we are operating on a type: release labeled issue if metadata is queried
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: Process Pending Backports
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ADD_BACKPORTS: ${{ inputs.add_backports }}
COMMENT_ID: ${{ inputs.comment_id }}
ISSUE: ${{ inputs.issue }}
run: |
ARGS=()
if [ -n "$ADD_BACKPORTS" ]; then
ARGS+=("--add=$ADD_BACKPORTS")
fi
if [ -n "$COMMENT_ID" ]; then
ARGS+=("--triggering-comment=$COMMENT_ID")
fi
bazel run //tools/private/release -- process-backports \
--issue "$ISSUE" \
--remote origin \
--no-dry-run \
"${ARGS[@]}"