-
Notifications
You must be signed in to change notification settings - Fork 51
30 lines (26 loc) · 1.03 KB
/
open-document-academy.yml
File metadata and controls
30 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Copy Issue on ODA Label Added
on:
issues:
types:
- labeled
jobs:
copy-issue:
if: github.event.label.name == 'ODA'
runs-on: ubuntu-latest
steps:
- name: Copy issue to Open Documentation Academy repository
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log('An issue has been labeled ODA. Copying the issue to the Open Documentation Academy repository.');
const issue = context.payload.issue;
const originRepo = context.payload.repository;
const originalIssueUrl = originRepo.html_url + '/issues/' + issue.number;
const copiedIssueBody = issue.body + '\n\n---\n\nCopied from: [' + originRepo.full_name + '#' + issue.number + '](' + originalIssueUrl + ')';
await github.rest.issues.create({
owner: 'canonical',
repo: 'open-documentation-academy',
title: issue.title,
body: copiedIssueBody
});