-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (43 loc) · 1.51 KB
/
content.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
name: Parse Issues
on:
issues:
types: [opened, edited]
jobs:
content:
if: contains(github.event.issue.labels.*.name, 'proposal') || contains(github.event.issue.labels.*.name, 'sre-summercamp')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Show event payload
run: |
echo $GITHUB_REPOSITORY
echo $GITHUB_EVENT_PATH
./scripts/create-content/main.py $GITHUB_EVENT_PATH
git status
git add -A
- name: Set issue number
id: issue-number
run: |
number=$(jq -r ".issue.number" $GITHUB_EVENT_PATH)
echo ::set-output name=number::$number
- name: Set issue title
id: issue-title
run: |
title=$(jq -r ".issue.title" $GITHUB_EVENT_PATH)
echo ::set-output name=title::$title
- name: Set issue author
id: issue-author
run: |
author=$(jq -r ".issue.user.login" $GITHUB_EVENT_PATH)
echo ::set-output name=author::$author
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
branch: "content/update-${{ steps.issue-number.outputs.number }}"
commit-message: "[automated change] Closes #${{ steps.issue-number.outputs.number }}"
title: "[Talk] ${{ steps.issue-title.outputs.title }}"
body: "Talk proposed by @${{ steps.issue-author.outputs.author }}\n\nRefs #${{ steps.issue-number.outputs.number }}"
delete-branch: true