Skip to content

Commit

Permalink
send message when job done
Browse files Browse the repository at this point in the history
  • Loading branch information
tranphuocloc070699 committed Jul 28, 2023
1 parent c90702a commit 44d347a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,17 @@ jobs:
<a href="https://github.com/${{ github.repository }}/commit/${{github.sha}}"><strong>Open URL</strong></a>
format: html
disable_web_page_preview: true
- name: Check last job status
id: lastJobStatus
continue-on-error: true
if: ${{always() && failure()}}
run: |
echo "Job status is ${{ job.status }}"
echo "error_message=$(tail -n 10000 ${{ github.workspace }}/path/to/your/log/file.log)" >> $GITHUB_OUTPUT
# - name: Check last job status
# id: lastJobStatus
# continue-on-error: true
# if: ${{always() && failure()}}
# run: |
# echo "Job status is ${{ job.status }}"
# echo "error_message=$(tail -n 10000 ${{ github.workspace }}/path/to/your/log/file.log)" >> $GITHUB_OUTPUT


- name: Send message whenever job fail
if: ${{always() && failure()}}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_BLOG_CHANEL_ID }}
Expand All @@ -110,8 +111,7 @@ jobs:
Actor: <strong>${{ github.actor }}</strong>
Branch: <strong>${{ steps.extract_branch.outputs.branch }}</strong>
Repository: <strong>${{ github.repository }}</strong>
Message: <pre>${{ steps.lastJobStatus.outputs.error_message }}</pre>
<a href="https://github.com/${{ github.repository }}/commit/${{github.sha}}"><strong>Open URL</strong></a>
format: html
disable_web_page_preview: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ServerApplication {
public static void main(String[] args) {

SpringApplication.run(ServerApplication.class, args);
System.out.println("abcxyz");

}

}

0 comments on commit 44d347a

Please sign in to comment.