-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the skeleton for the hackday discussions workflow.
- Loading branch information
1 parent
5e11bee
commit d22ff2f
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Generate Discussion Thread for Hackdays | ||
|
||
on: | ||
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: Set the Hackathon description | ||
run: | | ||
echo "DISCUSSION_BODY=Reporting out on earthaccess hack days. Use the 'comment' button at the very bottom to send a message. Additionally, consider sending issues and PRs relevant to your work to help make the job of future readers easier. It is okay to duplicate information here! Use the reply feature to have a discussion under any comment. Enjoy!" >> $GITHUB_ENV | ||
- name: Create Discussions | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPOSITORY_ID: "" | ||
CATEGORY_ID: "" | ||
run: | | ||
gh api graphql -f query=" | ||
mutation | ||
{createDiscussion | ||
( | ||
input: | ||
{ | ||
repositoryId: ${{ env.REPOSITORY_ID }}, | ||
categoryId: ${{ env.CATEGORY_ID }}, | ||
body: \"${{ env.DISCUSSION_BODY }}\", | ||
title: \"${{ env.DISCUSSION_TITLE }}\" | ||
} | ||
) | ||
{ | ||
discussion {id} | ||
} | ||
}" |