Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/prefill-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Prefill PR Body

on:
pull_request:
Comment thread
todi1856 marked this conversation as resolved.
types: [opened]

permissions:
pull-requests: write

jobs:
update-pr:
runs-on: ubuntu-latest

steps:
- name: Update PR body
uses: actions/github-script@v7
with:
script: |
const MARKER = "<!--Auto generated, don't edit-->";

const currentBody = context.payload.pull_request.body || "";
if (currentBody.includes(MARKER)) return;

const branch = encodeURIComponent(context.payload.pull_request.head.ref);
const yamatoUrl = "https://yamato.ds.unity3d.com/project/277/branch/" + branch + "/recent-jobs";

const yamatoBadge = "[![Yamato CI](https://img.shields.io/badge/Yamato-CI-blue?logo=unity&logoColor=white)](" + yamatoUrl + ")";

const buttons = MARKER + "\n" + yamatoBadge + "\n" + MARKER;

await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
body: `${buttons}\n\n${currentBody}`
});
Loading