Task submission #426
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
ref: main | |
- 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 | |
if: steps.info.outputs.SHOULD_OPEN_PR == '1' | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body-path: ${{ github.workspace }}/scripts/issue.md |