-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.55 KB
/
test-for-pr.yml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 'test for pr'
on:
workflow_dispatch:
push:
branches:
- main
paths:
- index.js
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: get-pull-request
uses: actions/[email protected]
with:
script: |
const {data: pullRequest } = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: 15,
});
core.info(pullRequest);
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/[email protected]
- name: create-pull-request
if: ${{ always() }}
uses: actions/[email protected]
with:
script: |
await github.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: 'prepare-release',
base: 'main',
title: 'test create',
body: `${{ steps.changelog_reader.outputs.changes }}`
});
- name: update-pull-request
if: ${{ always() }}
uses: actions/[email protected]
with:
script: |
await github.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: 15,
head: 'prepare-release',
base: 'main',
title: 'test update title.'
});