Petzys commited on
Commit
8e406f2
·
1 Parent(s): 501c6ed

fix: added testing to all branches and PRs, modified Discord message accordingly

Browse files
Files changed (1) hide show
  1. .github/workflows/test.yml +8 -4
.github/workflows/test.yml CHANGED
@@ -1,7 +1,11 @@
1
- name: Test code
2
  on:
3
  push:
4
- branches: [test]
 
 
 
 
5
 
6
  jobs:
7
  test-code:
@@ -27,7 +31,7 @@ jobs:
27
  DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
28
  run: |
29
  curl -X POST -H "Content-Type: application/json" \
30
- -d "{\"content\": \"A new commit was pushed to the test branch by $GITHUB_ACTOR. But the test has failed :sad: Github Actions are fun!\\n Test results: ${{ steps.test.outcome }}\"}" \
31
  $DISCORD_WEBHOOK_URL
32
  exit 1
33
 
@@ -37,6 +41,6 @@ jobs:
37
  DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
38
  run: |
39
  curl -X POST -H "Content-Type: application/json" \
40
- -d "{\"content\": \"A new commit was pushed to the test branch by $GITHUB_ACTOR. Tests have passed! :smile: Github Actions are fun!\\n Test results: ${{ steps.test.outcome }}\"}" \
41
  $DISCORD_WEBHOOK_URL
42
  exit 0
 
1
+ name: Test Code
2
  on:
3
  push:
4
+ branches:
5
+ - '**'
6
+ pull_request:
7
+ branches:
8
+ - '**'
9
 
10
  jobs:
11
  test-code:
 
31
  DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
32
  run: |
33
  curl -X POST -H "Content-Type: application/json" \
34
+ -d "{\"content\": \"A new commit $GITHUB_SHA was pushed to $GITHUB_REF_NAME by $GITHUB_ACTOR. But the test has failed :sad:\"}" \
35
  $DISCORD_WEBHOOK_URL
36
  exit 1
37
 
 
41
  DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
42
  run: |
43
  curl -X POST -H "Content-Type: application/json" \
44
+ -d "{\"content\": \"A new commit $GITHUB_SHA was pushed to $GITHUB_REF_NAME by $GITHUB_ACTOR. Tests have passed! :smile:\"}" \
45
  $DISCORD_WEBHOOK_URL
46
  exit 0