|
60 | 60 | commit_user_email: '[email protected]'
|
61 | 61 |
|
62 | 62 | ```
|
| 63 | + |
| 64 | +### Use with Doppler |
| 65 | + |
| 66 | +> NOTE: |
| 67 | +Author's doppler.com configuration token should be set as an secret variable in your GitHub repository with the name of the author followed by _DOPPLER_TOKEN. |
| 68 | + |
| 69 | +```bash |
| 70 | + - name: Set up doppler CLI |
| 71 | + uses: dopplerhq/cli-action@v1 |
| 72 | + |
| 73 | + - name: Set up author doppler token env variable |
| 74 | + run: | |
| 75 | + dopplerToKenName=$(echo "${GITHUB_ACTOR}_DOPPLER_TOKEN" | tr '[:lower:]' '[:upper:]') |
| 76 | + echo "DOPPLER_TOKEN=$dopplerToKenName" >> $GITHUB_ENV |
| 77 | + |
| 78 | + - name: Set up cross-post env variables from doppler |
| 79 | + run: | |
| 80 | + doppler run -- printenv | grep DOPPLER |
| 81 | + echo "DEVTO_API_KEY=$(doppler secrets get DEVTO_API_KEY --plain)" >> $GITHUB_ENV |
| 82 | + echo "DEVTO_ORG_ID=$(doppler secrets get DEVTO_ORG_ID --plain)" >> $GITHUB_ENV |
| 83 | + echo "MEDIUM_API_KEY=$(doppler secrets get MEDIUM_API_KEY --plain)" >> $GITHUB_ENV |
| 84 | + echo "MEDIUM_BLOG_ID=$(doppler secrets get MEDIUM_BLOG_ID --plain)" >> $GITHUB_ENV |
| 85 | + echo "HASHNODE_API_KEY=$(doppler secrets get HASHNODE_API_KEY --plain)" >> $GITHUB_ENV |
| 86 | + echo "HASHNODE_BLOG_ID=$(doppler secrets get HASHNODE_BLOG_ID --plain)" >> $GITHUB_ENV |
| 87 | + env: |
| 88 | + DOPPLER_TOKEN: ${{ secrets[env.DOPPLER_TOKEN] }} |
| 89 | + |
| 90 | +... |
| 91 | + |
| 92 | + uses: ommyjay/blogs-cross-post-action-for-teams@v1 |
| 93 | + id: cross_post |
| 94 | + with: |
| 95 | + with: |
| 96 | + files_location: 'posts/**/*.md' |
| 97 | + dry_run: 'true' |
| 98 | + publish: 'false' |
| 99 | + devto_api_key: ${{ env.DEVTO_API_KEY }} |
| 100 | + medium_api_key: ${{ env.MEDIUM_API_KEY }} |
| 101 | + devto_org_id: ${{ env.DEVTO_ORG_ID }} |
| 102 | + medium_blog_id: ${{ env.MEDIUM_BLOG_ID}} |
| 103 | + hashnode_api_key: ${{ env.HASHNODE_API_KEY }} |
| 104 | + hashnode_blog_id: ${{ env.HASHNODE_BLOG_ID }} |
| 105 | + |
| 106 | + - name: Clean up changed files |
| 107 | + run: git rm `git ls-files --deleted` || exit 0; |
| 108 | + |
| 109 | + - name: Commit new files |
| 110 | + uses: stefanzweifel/git-auto-commit-action@v4 |
| 111 | + with: |
| 112 | + commit_message: '⚙️ AUTOMATED: Add posted articles files ${{ steps.cross_post.outputs.posted_articles }}' |
| 113 | + file_pattern: posts/**/*.md |
| 114 | + commit_user_name: ommyjay |
| 115 | + commit_user_email: '[email protected]' |
| 116 | +``` |
| 117 | + |
| 118 | +### TODO |
| 119 | + |
| 120 | +- [ ] Create a separate Doppler action to retrieve Author's doppler.com configuration token |
| 121 | +- [ ] Handle post cross-posting git cleanup steps within the action |
| 122 | +- [ ] Handle post cross-posting git commit steps within the action |
0 commit comments