Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow for generating Hackday Github Discussion threads #914

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/discussions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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: MDEwOlJlcG9zaXRvcnkzOTk4Njc1Mjk=
CATEGORY_ID: DIC_kwDOF9V-ic4CdYaN!
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}
}
}"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [Unreleased]

- Added a workflow for generating Hackday Github Discussions thread
([#801](https://github.com/nsidc/earthaccess/issues/801))
([@Sherwin-14](https://github.com/Sherwin-14),
[@mfisher87](https://github.com/mfisher87))

## [v0.12.0] - 2024-11-13

### Changed
Expand Down
Loading