Can you make it brand-less? #13
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: Github issue -> Notion card | |
on: | |
workflow_dispatch: | |
issues: | |
types: [opened] | |
jobs: | |
issue: | |
name: "Issue to Notion" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: | | |
people=$(for i in $(echo $NOTION_USER_IDS | tr "," " "); do echo -n '{"object":"user","id":"'$i'"},'; done) | |
curl 'https://api.notion.com/v1/pages' \ | |
-H 'Authorization: Bearer '"$NOTION_TOKEN"'' \ | |
-H "Content-Type: application/json" \ | |
-H "Notion-Version: 2022-02-22" \ | |
--data '{"parent":{"type":"database_id","database_id":"'"$DATABASE_ID"'"},"icon":{"type":"emoji","emoji":"🐛"},"properties":{"Name":{"type":"title","title":[{"type":"text","text":{"content":"'"$(echo $TITLE | tr '"' "'")"'"}}]},"Assigned":{"people":['${people:0:-1}']},"Status":{"select":{"name":"'"$STATUS"'"}},"Flag":{"multi_select":[{"name":"'"$FLAG"'"}]},"Database":{"multi_select":[{"name":"'"$DATABASE_NAME"'"}]},"Type":{"multi_select":[{"name":"bug"}]},"Project":{"multi_select":[{"name":"'"$PROJECT_NAME"'"}]}},"children":[{"object":"block","type":"bookmark","bookmark":{"url":"'"$ISSUE_URL"'"}}]}' | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
STATE: ${{ github.event.issue.state }} | |
ISSUE_URL: ${{ github.event.issue.html_url }} | |
TITLE: ${{ github.event.issue.title }} | |
FLAG: Next Sprint | |
DATABASE_NAME: Product | |
STATUS: Backlog | |
# Product Work Board | |
DATABASE_ID: 69f0e513a59d445b87a1baed729c75c5 | |
PROJECT_NAME: web3-onboard | |
# User ids of who to assign the card to in notion: Taylor, Adam, Aaron | |
NOTION_USER_IDS: f6cbb362-4908-4138-9ef0-434003d9a9f8,8a3a2287-5d2c-4665-906d-02ae9a113340,3b407adf-6552-40de-b22f-5efa852c34a2,436b76c5-fed3-42d2-b3ca-49bb882843f8 | |
shell: bash |