Repository navigation
61 lines (53 loc) · 1.96 KB
/
Copy pathtorchrlbot.yml
File metadata and controls
61 lines (53 loc) · 1.96 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
# @torchrlbot - PR management bot for torchrl
#
# Triggered by PR comments starting with `@torchrlbot`.
# See .github/torchrlbot/README.md for full documentation.
#
# Commands:
# @torchrlbot merge [-f 'reason'] Merge a PR (ghstack land or squash merge)
# @torchrlbot rebase [-b BRANCH] Rebase PR onto a branch (default: main)
# @torchrlbot reviewer USER... Request reviews from collaborators
# @torchrlbot help Show available commands
name: TorchRLBot
on:
issue_comment:
types: [created]
jobs:
torchrlbot:
# Only run on PR comments (not issue comments) that mention @torchrlbot
if: >-
github.event.issue.pull_request != null &&
contains(github.event.comment.body, '@torchrlbot')
runs-on: ubuntu-latest
permissions:
# Rebase/push same-repository branches, delete branches, and merge PRs.
contents: write
# Read PR metadata, request reviewers, and merge PRs.
pull-requests: write
# React to commands and post status comments on PR conversations.
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Full history needed for rebase operations
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install ghstack pytest
- name: Test TorchRLBot
run: python -m pytest .github/torchrlbot/test_torchrlbot.py -q
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Run torchrlbot
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: python .github/torchrlbot/torchrlbot.py