Add new discussions to project #2
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] | |
jobs: | |
add-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@v7 | |
with: | |
github-token: ${{ steps.generate_token.outputs.token }} | |
script: | | |
const discussion = await github.rest.discussions.get({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
discussion_number: context.payload.discussion.number | |
}); | |
return discussion.data.node_id; | |
- 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 }} |