├── assets └── douban.png ├── entrypoint.sh ├── Dockerfile ├── LICENSE ├── action.yml └── README.md /assets/douban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/doumark-action/HEAD/assets/douban.png -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | export GITHUB="true" 6 | 7 | sh -c "/bin/doumark $*" -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lizheming/drone-doumark:1.4.5 2 | 3 | COPY entrypoint.sh /entrypoint.sh 4 | RUN chmod +x /entrypoint.sh 5 | ENTRYPOINT ["/entrypoint.sh"] 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Austin Lee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Douban mark sync" 2 | author: "Austin Lee" 3 | description: "Douban movie/book/music marked data sync to csv or notion action" 4 | 5 | inputs: 6 | id: 7 | description: "Your douban user_id" 8 | required: true 9 | type: 10 | description: "Douban data Type, enum value: `movie`, `book`, `music`, default `movie`" 11 | default: movie 12 | required: false 13 | status: 14 | description: "Douban data status, enum value: `mark`, `doing`, `done`, default `done`" 15 | default: done 16 | required: false 17 | format: 18 | description: "Douban data store format, enum value:`csv`, `json`, `notion`, default `csv`" 19 | default: csv 20 | required: false 21 | dir: 22 | description: "Target where douban data sync to. It's a file path for `csv` and `json` format, and a notion database id for `notion` format." 23 | default: ./ 24 | required: true 25 | notion_token: 26 | description: "Notion Integration Token" 27 | required: false 28 | neodb_token: 29 | description: "NeoDB Access Token" 30 | required: false 31 | 32 | runs: 33 | using: "docker" 34 | image: "Dockerfile" 35 | 36 | branding: 37 | icon: "activity" 38 | color: "green" 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](assets/douban.png) 2 | # Douban sync for GitHub Actions 3 | 4 | [GitHub Action](https://github.com/features/actions) for douban movie/book/music marked data sync to csv file or notion automatically. 5 | 6 | ## Input variables 7 | 8 | See [action.yml](action.yml) for more detailed information. 9 | - id: Douban ID 10 | - type: Douban data Type, enum value: movie, book, music, game default `movie` 11 | - status: Douban data status, enum value: mark, doing, done, default `done` 12 | - format: Douban data store format, enum value:csv, json, notion, neodb default `csv` 13 | - dir: Target where douban data sync to. It's a file path for `csv` and `json` format, and a notion database id for `notion` format. 14 | - notion_token: Notion Integration Token 15 | - neodb_token: NeoDB Access Token 16 | 17 | ## Usage 18 | 19 | ### Sync to CSV file 20 | 21 | ```yml 22 | # .github/workflows/douban.yml 23 | name: douban 24 | on: 25 | schedule: 26 | - cron: "30 * * * *" 27 | 28 | jobs: 29 | douban: 30 | name: Douban mark data sync 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Checkout 34 | uses: actions/checkout@v2 35 | 36 | - name: movie 37 | uses: lizheming/doumark-action@master 38 | with: 39 | id: lizheming 40 | type: movie 41 | format: csv 42 | dir: ./data/douban 43 | 44 | - name: music 45 | uses: lizheming/doumark-action@master 46 | with: 47 | id: lizheming 48 | type: music 49 | format: csv 50 | dir: ./data/douban 51 | 52 | - name: Commit 53 | uses: EndBug/add-and-commit@v8 54 | with: 55 | message: 'chore: update douban data' 56 | add: './data/douban' 57 | ``` 58 | ### Sync to Notion 59 | 60 | 1. Create a Notion Integration at [My Integrations - Notion](https://www.notion.so/my-integrations). And here you can get `NOTION_TOKEN`. 61 | - Associated workspace: You should select workspace which you should store. 62 | - Capabilities: Both of `Read`, `Update` and `Insert` content abilities shoud checked. 63 | 2. Duplicate database by click Duplicate at the top right postion of <[Movie](https://lizheming.notion.site/d8a363df3ca84ca89ef52208ad874e3b) | [Book](https://lizheming.notion.site/488c17fd89fb424591f68f7cfb029020) | [Music](https://lizheming.notion.site/d80ca60213c54ab99c4376caec0be9d7)> page. 64 | 3. Share database to your Integration by inviting it with Share - Invite at the top right postion. And you can get database id, the first random string from url. 65 | 66 | ```yml 67 | # .github/workflows/douban.yml 68 | name: douban 69 | on: 70 | schedule: 71 | - cron: "30 * * * *" 72 | 73 | jobs: 74 | douban: 75 | name: Douban mark data sync 76 | runs-on: ubuntu-latest 77 | steps: 78 | - name: movie 79 | uses: lizheming/doumark-action@master 80 | with: 81 | id: lizheming 82 | type: movie 83 | format: notion 84 | dir: xxxx 85 | notion_token: ${{ secrets.notion_token }} 86 | 87 | - name: music 88 | uses: lizheming/doumark-action@master 89 | with: 90 | id: lizheming 91 | type: music 92 | format: notion 93 | dir: xxxx 94 | notion_token: ${{ secrets.notion_token }} 95 | ``` 96 | 97 | ### Sync to NeoDB 98 | 99 | 100 | 1. Create a NeoDB Access Token at [NeoDB API Developer Console](https://neodb.social/developer/). 101 | 102 | ```yml 103 | # .github/workflows/douban.yml 104 | name: douban 105 | on: 106 | schedule: 107 | - cron: "30 * * * *" 108 | 109 | jobs: 110 | douban: 111 | name: Douban mark data sync 112 | runs-on: ubuntu-latest 113 | steps: 114 | - name: movie 115 | uses: lizheming/doumark-action@master 116 | with: 117 | id: lizheming 118 | type: movie 119 | format: neodb 120 | neodb_token: ${{ secrets.neodb_token }} 121 | 122 | - name: music 123 | uses: lizheming/doumark-action@master 124 | with: 125 | id: lizheming 126 | type: music 127 | format: neodb 128 | neodb_token: ${{ secrets.neodb_token }} 129 | ``` --------------------------------------------------------------------------------