File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Discord Push Notifications
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+
7+ jobs :
8+ notify :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Build commit list
12+ id : commits
13+ run : |
14+ COMMIT_TEXT=""
15+ while read commit; do
16+ MSG=$(echo "$commit" | jq -r '.message')
17+ URL=$(echo "$commit" | jq -r '.url')
18+
19+ # Skip commits starting with "Merge branch"
20+ if [[ "$MSG" == Merge\ branch* ]]; then
21+ continue
22+ fi
23+
24+ COMMIT_TEXT="${COMMIT_TEXT}- [$MSG]($URL)
25+ "
26+ done < <(jq -c '.commits[]' < "${GITHUB_EVENT_PATH}")
27+
28+ # Write output for later steps
29+ echo "commit_text<<EOF" >> $GITHUB_OUTPUT
30+ echo "$COMMIT_TEXT" >> $GITHUB_OUTPUT
31+ echo "EOF" >> $GITHUB_OUTPUT
32+
33+ - name : Send commits to Discord
34+ uses : sarisia/actions-status-discord@v1.15.4
35+ with :
36+ webhook : ${{ secrets.DISCORD_WEBHOOK }}
37+ title : " New Update"
38+ description : |
39+ **New push to ${{ github.ref_name }}**
40+ ${{ steps.commits.outputs.commit_text }}
41+ noprefix : true
42+ nocontext : true
43+ content : " <@&1411181618307137628>"
You can’t perform that action at this time.
0 commit comments