forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 38
52 lines (44 loc) · 1.98 KB
/
discord_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
name: Discord Discussions
on:
pull_request_target:
types:
- opened
- reopened
- edited
- labeled
- closed
branches:
- master
concurrency:
group: "discord-discussions-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
manage-discord-discussion:
name: Manage Discord Discussion
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'Discord Discussion')
steps:
- name: Fail if vars.DISCORD_DISCUSSIONS_CHANNEL_ID is unset
if: ${{ vars.DISCORD_DISCUSSIONS_CHANNEL_ID == '' }}
run: |
echo "vars.DISCORD_DISCUSSIONS_CHANNEL_ID (${{ vars.DISCORD_DISCUSSIONS_CHANNEL_ID }}) must be set to use this label!"
exit 1
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-quality: ga
- name: Checkout
uses: actions/checkout@v4
- name: Build Tgstation.DiscordDiscussions
run: dotnet publish -c Release -o discord_discussions_bins tools/Tgstation.DiscordDiscussions/Tgstation.DiscordDiscussions.csproj
- name: Generate App Token
id: app-token-generation
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Run Tgstation.DiscordDiscussions
run: dotnet discord_discussions_bins/Tgstation.DiscordDiscussions.dll ${{ steps.app-token-generation.outputs.token }} ${{ github.repository_owner }} ${{ github.event.repository.name }} ${{ github.event.pull_request.number }} ${{ github.event.pull_request.merged && 'merged' || github.event.pull_request.state }} ${{ secrets.DISCORD_DISCUSSIONS_TOKEN }} ${{ vars.DISCORD_DISCUSSIONS_CHANNEL_ID }} ${{ github.event.action == 'reopened' && 'true' || 'false' }} ${{ vars.DISCORD_JOIN_LINK }}
env:
GITHUB_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}