Skip to content

Merge branch 'main' into discussions #88

Merge branch 'main' into discussions

Merge branch 'main' into discussions #88

Workflow file for this run

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: 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." >> $GITHUB_ENV
- name: Create Discussions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_ID: \"R_kgDOL9OsOA\"
CATEGORY_ID: \"DIC_kwDOL9OsOM4ClttG\"
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}
}
}"