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
44 changes: 44 additions & 0 deletions .github/workflows/create-issue-on-pr-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create Issue on PR Opened

on:
pull_request:
types: [opened]

jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- name: Create an issue
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const title = `New PR Opened: #${context.payload.pull_request.number} - ${context.payload.pull_request.title}`;
const body = `
A new pull request has been opened!

**Title:** ${context.payload.pull_request.title}
**Author:** ${context.payload.pull_request.user.login}

**Link:** ${context.payload.pull_request.html_url}

Authorized maintainers may send commands to the build
bots by creating new comments here. A line with a
command has the format <code>bot: COMMANDS [ARGS]</code>

The following COMMANDS are supported:

- <code>help</code> _prints short usage information_
- <code>show_config</code> _lets bots reply with key config information_
- <code>status</code> _shows status information of builds_
- <code>build [architecture|instance|repository|accelerator|exportvariable]</code> _instructs bots to build software according to the linked PR_
`;

const issue = await github.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
});

console.log(`Created issue: ${issue.data.html_url}`);