-
-
Notifications
You must be signed in to change notification settings - Fork 55
58 lines (53 loc) · 1.67 KB
/
create-discussions.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
name: Create GitHub Discussions
on:
pull_request:
types: [opened]
paths:
- 'src/content/apps/**'
workflow_dispatch:
inputs:
name:
description: 'App Name'
required: true
type: string
author:
description: 'App Author'
required: true
type: string
description:
description: 'App Description'
required: true
type: string
jobs:
create-discussion:
runs-on: ubuntu-latest
permissions:
discussions: write
pull-requests: read
contents: read
steps:
- uses: actions/checkout@v4
- name: Get App Data
id: app-data
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "name=${{ inputs.name }}" >> $GITHUB_OUTPUT
echo "author=${{ inputs.author }}" >> $GITHUB_OUTPUT
echo "description=${{ inputs.description }}" >> $GITHUB_OUTPUT
else
# Add script to extract app data from PR changes
echo "name=..." >> $GITHUB_OUTPUT
echo "author=..." >> $GITHUB_OUTPUT
echo "description=..." >> $GITHUB_OUTPUT
fi
- name: Create Discussion
uses: abirismyname/[email protected]
with:
title: "Vote: ${{ steps.app-data.outputs.name }} by ${{ steps.app-data.outputs.author }}"
body: |
🗳️ **Vote for this app by giving it a 👍 reaction!**
${{ steps.app-data.outputs.description }}
repository-id: ${{ secrets.REPO_ID }}
category-id: ${{ secrets.CAT_ID }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}