Skip to content

Commit

Permalink
check status 123
Browse files Browse the repository at this point in the history
  • Loading branch information
tranphuocloc070699 committed Jul 28, 2023
1 parent 9672606 commit 1eb1664
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,21 @@ jobs:

- name: Check last job status
id: lastJobStatus
if: always()
run: |
LAST_JOB_STATUS=$(gh run list --workflow backend-cd.yaml | grep -oh "completed.*" | head -1 | awk '{print $2}')
THIS_JOB_STATUS="${{ job.status }}"
if [ "$LAST_JOB_STATUS" != "$THIS_JOB_STATUS" ]; then
echo "status changed from $LAST_JOB_STATUS to $THIS_JOB_STATUS"
echo "::set-output name=changedState::true"
echo "::set-output name=stateMessage::Test status changed from '$LAST_COMPLETED_JOB_STATUS' to '$THIS_JOB_STATUS'."
else
echo "status is still $THIS_JOB_STATUS"
echo "::set-output name=changedState::false"
echo "::set-output name=stateMessage::$THIS_JOB_STATUS"
fi
- name: Showcase output variable
if: always() && steps.lastJobStatus.outputs.changedState == 'true'
run: echo "CHANGED STATE!!!"
run: echo "${{job.status}}"
if: always() && ${{job.status}}== 'failure'
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_BLOG_CHANEL_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
message: |
<strong >FAILURE ❌</strong>
Actor: <strong>${{ github.actor }}</strong>
Branch: <strong>${{ steps.extract_branch.outputs.branch }}</strong>
Repository: <strong>${{ github.repository }}</strong>
<a href="https://github.com/${{ github.repository }}/commit/${{github.sha}}"><strong>Open URL</strong></a>
format: html
disable_web_page_preview: true

send-telegram-message:
needs: deploy
Expand Down
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);
String a = "abcxyz";
System.out.println("abcssww");


}
Expand Down

0 comments on commit 1eb1664

Please sign in to comment.