1 files | skyblock_garden.json #2866
This file contains hidden or 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: Post diff to Discord | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| post: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch HEAD and the commit before it | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| - name: Ping and Post GitHub Link | |
| # 1170028890442440839 is API Updates | |
| uses: ILikePlayingGames/discord-webhook@c533d6b0fda570a8fd1676878c05bc4f50cc1240 | |
| with: | |
| webhook-url: ${{ secrets.WEBHOOK_URL }} | |
| username: API Update Tracker | |
| avatar-url: 'https://cdn.discordapp.com/avatars/999680196040982618/df91181b3f1cf0ef1592fbe18e0962d7.webp' | |
| content: | | |
| <@&1170028890442440839> | |
| ${{ format('[GitHub Link](<{0}/{1}/commit/{2}>)', github.server_url, github.repository, github.sha) }} | |
| - name: Get formatted diff | |
| id: get_diff | |
| uses: ILikePlayingGames/[email protected] | |
| with: | |
| commit-hash: '@~' | |
| diff-algorithm: histogram | |
| delta-theme: discord | |
| - name: Wrap diff in code block | |
| run: >- | |
| sed -i -e 's/`/\\`/g' -e '1i```ansi' -e '$a```\n' diff.txt | |
| - name: Count diff characters | |
| run: >- | |
| echo "DIFF_CHAR_COUNT=$(wc -c < diff.txt)" >> $GITHUB_ENV | |
| - name: Post as message to Discord | |
| if: ${{ env.DIFF_CHAR_COUNT <= 2000 }} | |
| uses: ILikePlayingGames/discord-webhook@c533d6b0fda570a8fd1676878c05bc4f50cc1240 | |
| with: | |
| webhook-url: ${{ secrets.WEBHOOK_URL }} | |
| username: API Update Tracker | |
| avatar-url: 'https://cdn.discordapp.com/avatars/999680196040982618/df91181b3f1cf0ef1592fbe18e0962d7.webp' | |
| raw-content: diff.txt | |
| - name: Post as file to Discord | |
| if: ${{ env.DIFF_CHAR_COUNT > 2000 }} | |
| uses: ILikePlayingGames/discord-webhook@c533d6b0fda570a8fd1676878c05bc4f50cc1240 | |
| with: | |
| webhook-url: ${{ secrets.WEBHOOK_URL }} | |
| username: API Update Tracker | |
| avatar-url: 'https://cdn.discordapp.com/avatars/999680196040982618/df91181b3f1cf0ef1592fbe18e0962d7.webp' | |
| filename: diff.txt |