Skip to content

Commit

Permalink
fix: gradle.yaml so it releases on discord
Browse files Browse the repository at this point in the history
  • Loading branch information
RemainingToast committed Jun 5, 2023
1 parent 26d8fd0 commit be9d9fe
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/gradle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ jobs:
- name: Get branch name
uses: nelonoel/branch-name@v1.0.1
id: branch
- name: Get previous commit
id: prev_commit
run: |
PREVIOUS_COMMIT=$(git rev-parse HEAD~1)
echo "${PREVIOUS_COMMIT}" >> prev_commit.txt
- name: Get commit messages
id: commit_messages
run: |
PREVIOUS_COMMIT=$(cat prev_commit.txt)
COMMIT_MESSAGES=$(git log --pretty=format:'- `%h` %s' $PREVIOUS_COMMIT..${{ github.sha }} --reverse)
echo "${COMMIT_MESSAGES}" >> commit_messages.txt
# - name: Get previous commit
# id: prev_commit
# run: |
# PREVIOUS_COMMIT=$(git rev-parse HEAD~1)
# echo "${PREVIOUS_COMMIT}" >> prev_commit.txt
# - name: Get commit messages
# id: commit_messages
# run: |
# PREVIOUS_COMMIT=$(cat prev_commit.txt)
# COMMIT_MESSAGES=$(git log --pretty=format:'- `%h` %s' $PREVIOUS_COMMIT..${{ github.sha }} --reverse)
# echo "${COMMIT_MESSAGES}" >> commit_messages.txt
- name: Send Discord build message
run: |
COMMIT_MESSAGES=$(cat commit_messages.txt)
# COMMIT_MESSAGES=$(cat commit_messages.txt)
COMMIT_MESSAGES=$(git log --pretty=format:'- `%h` %s' -5 --reverse)
(curl "$WEBHOOK" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Build $BUILD\",\"description\":\"**Branch:** $BRANCH_NAME\\n**Changes:**\\n$COMMIT_MESSAGES\",\"url\":\"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [toastclient-$BUILD.zip](https://nightly.link/$GITHUB_REPOSITORY/workflows/gradle.yaml/$BRANCH_NAME/toastclient-$BUILD.zip)\"}],\"footer\":{\"text\":\"$GITHUB_REPOSITORY\"},\"thumbnail\":{\"url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}}]}")

0 comments on commit be9d9fe

Please sign in to comment.