Avoid strict pending reads on browse cache misses #11
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: Deploy Notification | |
| on: | |
| push: | |
| branches: [production] | |
| jobs: | |
| notify: | |
| name: Discord Notification | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build commit summary | |
| id: info | |
| run: | | |
| BEFORE="${{ github.event.before }}" | |
| HEAD="${{ github.sha }}" | |
| SHORT_HEAD="$(git rev-parse --short HEAD)" | |
| if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then | |
| LOG="$(git log -1 --pretty='%h %s (%an)')" | |
| COUNT=1 | |
| else | |
| COUNT="$(git rev-list --count "${BEFORE}..${HEAD}")" | |
| LOG="$(git log --pretty='%h %s (%an)' "${BEFORE}..${HEAD}" | head -15)" | |
| if [ "$COUNT" -gt 15 ]; then | |
| LOG="${LOG} | |
| ...and $((COUNT - 15)) more" | |
| fi | |
| fi | |
| { | |
| echo "log<<DELIM" | |
| echo "$LOG" | |
| echo "DELIM" | |
| } >> "$GITHUB_OUTPUT" | |
| echo "count=$COUNT" >> "$GITHUB_OUTPUT" | |
| echo "short_sha=$SHORT_HEAD" >> "$GITHUB_OUTPUT" | |
| - name: Notify Discord | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| DEPLOY_LOG: ${{ steps.info.outputs.log }} | |
| COMMIT_COUNT: ${{ steps.info.outputs.count }} | |
| SHORT_SHA: ${{ steps.info.outputs.short_sha }} | |
| COMPARE_URL: https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.sha }} | |
| run: | | |
| jq -n \ | |
| --arg title "Wasteland deployed to production" \ | |
| --arg desc "$DEPLOY_LOG" \ | |
| --arg count "$COMMIT_COUNT commit(s)" \ | |
| --arg sha "$SHORT_SHA" \ | |
| --arg url "$COMPARE_URL" \ | |
| '{embeds: [{ | |
| title: $title, | |
| description: $desc, | |
| color: 5025616, | |
| fields: [ | |
| {name: "Commits", value: $count, inline: true}, | |
| {name: "Head", value: $sha, inline: true} | |
| ], | |
| url: $url | |
| }]}' | curl -fsSL -H "Content-Type: application/json" -d @- "$DISCORD_WEBHOOK" |