Skip to content

“Ingest” Issues reply with links to the PR #142

@blackboxprogramming

Description

@blackboxprogramming

name: Ingest Reply with PR Link

on:
pull_request:
types: [opened]

permissions:
pull-requests: read
issues: write

jobs:
reply-link:
if: startsWith(github.head_ref, 'auto/ingest-')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
// Try to extract the issue number from branch name: auto/ingest-123
const m = pr.head.ref.match(/^auto/ingest-(\d+)$/);
if (!m) return;
const issue_number = Number(m[1]);
const url = pr.html_url;
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number,
body: 🔗 PR opened: ${url}\nMerge will bring files to \main`.`
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions