-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (49 loc) · 1.85 KB
/
enqueue.yml
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
name: Enqueue
on:
issue_comment:
types: [created, edited]
jobs:
build:
if: github.event.issue.number == 1312 && github.event.sender.type == 'User'
runs-on: [self-hosted, enqueue]
permissions:
issues: write
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Set up Git
run: ${{ github.workspace }}/scripts/setup_git.sh
- name: Set up pre-commit info
id: info
run: |
echo -e "> $PATCH_URL\n\n" > ${{ github.workspace }}/scripts/issue.md
python3 ${{ github.workspace }}/scripts/enqueue.py 2>&1 | tee -a ${{ github.workspace }}/scripts/issue.md
env:
PATCH_URL: ${{ github.event.comment.body }}
USER: ${{ github.event.sender.login }}
- name: Create PR
if: steps.info.outputs.SHOULD_OPEN_PR == '1'
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PAT }}
branch: "test-run${{ github.run_id }}"
commit-message: "pre-commit: PR${{ steps.info.outputs.PR_TITLE }}"
title: "pre-commit: PR${{ steps.info.outputs.PR_TITLE }}"
add-paths: scripts/setup_pre_commit_patch.sh
body: |
Link: ${{ github.event.comment.body }}
Requested by: @${{ github.event.sender.login }}
- name: Update report
if: ${{ steps.cpr.outputs.pull-request-number }}
run:
echo -e "> ${{ github.event.comment.body }}\n\nSee ${{ steps.cpr.outputs.pull-request-url }}" > ${{ github.workspace }}/scripts/issue.md
- name: Comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body-path: ${{ github.workspace }}/scripts/issue.md