Create Pull Requests #6
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: Create Pull Requests | |
on: | |
workflow_dispatch: | |
inputs: | |
autoqueue: | |
description: Whether to put the PR in queue automatically | |
type: boolean | |
jobs: | |
create-pull-request: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
mkdir testbed | |
echo `uuidgen` > testbed/`uuidgen` | |
- name: Generate Random Animal Emoji | |
id: random_animal_emoji | |
run: | | |
EMOJI_LIST=('๐ถ' '๐ฑ' '๐ญ' '๐น' '๐ฐ' '๐ฆ' '๐ป' '๐ผ' '๐จ' '๐ฏ' '๐ฆ' '๐ฎ' '๐ท' '๐ธ' '๐ต' '๐ฆ' '๐' '๐ฆ' '๐ง' '๐ฆ') | |
RANDOM_EMOJI=${EMOJI_LIST[$RANDOM % ${#EMOJI_LIST[@]}]} | |
echo "RANDOM_EMOJI=$RANDOM_EMOJI" >> $GITHUB_ENV | |
- name: Create a pull request (autoqueue) | |
if: ${{ inputs.autoqueue }} | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: ${{env.RANDOM_EMOJI}} pull request | |
body: > | |
This is a test pull request. | |
It will be put in queue automatically by Mergify right now. | |
You can chose the queue by adding a label: | |
- Use the `hotfix` label to put the PR in the hotfix queue; | |
- Use the `lowprio` label to put the PR in the lowprio queue; | |
- Do not set any label to have it enter the default queue. | |
labels: autoqueue | |
- name: Create the hotfix pull request | |
if: ${{ ! inputs.autoqueue }} | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: ${{env.RANDOM_EMOJI}} pull request | |
body: > | |
This is a test pull request! | |
To put it in queue, run the `@mergifyio queue` command by posting a | |
comment. | |
You can use label to route the PR to any queue: | |
- `@mergifyio queue hotfix` to enter the hotfix queue; | |
- `@mergifyio queue` to enter the default queue; | |
- `@mergifyio queue lowprio` to enter the lowprio queue; | |
labels: |