-
Notifications
You must be signed in to change notification settings - Fork 38
55 lines (46 loc) · 1.66 KB
/
add-lab-member.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
name: Add lab member
on:
issues:
types: [opened, edited]
permissions:
contents: write
issues: write
pull-requests: write
jobs:
process-issue:
if: contains(github.event.issue.labels.*.name, 'members-bot')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Parse Issue
id: parse-issue
uses: GrantBirki/[email protected]
with:
body: ${{ github.event.issue.body }}
csv_to_list: false
- name: Create PR body with Fixes line
run: |
echo "Fixes #${{ github.event.issue.number }}" > /tmp/pr-body.md
echo "" >> /tmp/pr-body.md
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Add lab member
id: output-issue
run: echo ${{ toJson(steps.parse-issue.outputs.json) }} | deno run -A scripts/create-hidive-member.ts - >> /tmp/pr-body.md
- name: Extract content
id: extract-content
run: |
SLUG=$(echo ${{ toJson(steps.parse-issue.outputs.json) }} | jq -r .slug)
NAME=$(echo ${{ toJson(steps.parse-issue.outputs.json) }} | jq -r .name)
echo "slug=$SLUG" >> $GITHUB_OUTPUT
echo "name=$NAME" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: "members-bot: Add ${{ steps.extract-content.outputs.name }}"
commit-message: "members-bot: Add ${{ steps.extract-content.outputs.name }}"
branch: "news/${{ steps.extract-content.outputs.slug }}"
body-path: /tmp/pr-body.md
labels: members-bot