Skip to content

Generate Discussion Thread for Hackdays #20

Generate Discussion Thread for Hackdays

Generate Discussion Thread for Hackdays #20

Workflow file for this run

name: Generate Discussion Thread for Hackdays
on:
workflow_dispatch:
jobs:
create-discussion-threads:
runs-on: ubuntu-latest
permissions:
discussions: write
contents: read
steps:
- name: temp1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api graphql -f query="mutation { createDiscussion(input: {repositoryId: ${{secrets.REPO_ID}}, categoryId: ${{secrets.CAT_ID }}, body: \"a\", title: "\b\"}) {discussion {id}}}"
- name: Create a new GitHub Discussion
id: create-discussion
uses: abirismyname/[email protected]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: Hackathon
body: |
Reporting out on earthaccess hack days.
Please create a new comment (at the very bottom, use the text box with a button that says "comment", not "reply") to write about what you did today!
Please include links to GitHub issues or pull requests relevant to your work, and use those issues or pull requests as the "source of truth" for documenting the work; this makes future readers jobs easier :) It's OK to duplicate some information while writing a summary here!
Use the "reply" feature to have a discussion under any given comment.
repository-id: ${{ secrets.REPO_ID }}
category-id: ${{ secrets.CAT_ID }}
- name: Print discussion url and id
run: |
if [ -n "${{steps.create-discussion.outputs.discussion-id}}" ]; then
echo discussion-id: ${{steps.create-discussion.outputs.discussion-id}}
echo discussion-url: ${{steps.create-discussion.outputs.discussion-url}}
else
echo "Discussion not created"