Add new discussions to project #31
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
name: Add new discussions to project | |
on: | |
discussion: | |
types: [created, reopened] | |
jobs: | |
add-to-project: | |
name: Add discussion to project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Get discussion details | |
id: get-discussion | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ steps.generate_token.outputs.token }} | |
script: | | |
console.log('Event payload:', JSON.stringify(context.payload, null, 2)); | |
const discussionId = context.payload.discussion.node_id; | |
console.log('Discussion ID:', discussionId); | |
return discussionId; | |
- name: Add to project | |
uses: actions/[email protected] | |
with: | |
project-url: https://github.com/orgs/stampchain-io/projects/3 | |
github-token: ${{ steps.generate_token.outputs.token }} | |
content-id: ${{ steps.get-discussion.outputs.result }} |