forked from nsidc/earthaccess
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.24 KB
/
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
name: Generate Discussion Thread for Hackdays
on:
push:
branches:
- discussions
- main
workflow_dispatch:
jobs:
create-discussion-threads:
runs-on: ubuntu-latest
permissions:
discussions: write
contents: read
steps:
- name: Generate the Hackathon title
run: |
DATE=$(date --iso-8601 | sed 's|-|/|g')
echo "DISCUSSION_TITLE=\"Hackathon $DATE\"" >> $GITHUB_ENV
- name: Create Discussions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CATEGORY_ID: \"DIC_kwDOL9OsOM4ClttG\"
run: |
gh api graphql -f query="
mutation
{createDiscussion
(
input:
{
repositoryId: ${{ env.REPOSITORY_ID }},
categoryId: ${{ env.CATEGORY_ID }},
body: \"Reporting out on earthaccess hack days. You can create a new comment at the very bottom using the 'comment' button. Additionally, consider adding links to the issues or Pull Requests relevant to your work to make the job of future readers easier.\"
title: ${{ env.DISCUSSION_TITLE }}
}
)
{
discussion {id}
}
}"