-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for reporting via all jobs status (#7)
Allows the action to report using the status of all jobs in the workflow resolves #4
- Loading branch information
Showing
9 changed files
with
4,801 additions
and
14,099 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ jobs: | |
- run: npm install | ||
- run: npm test | ||
|
||
- uses: iRoachie/slack-github-actions@v1.1.1 | ||
- uses: iRoachie/slack-github-actions@v2.0.0 | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
|
@@ -99,9 +99,11 @@ Here's an example with jobs that run in parallel. | |
|
||
It does a few things: | ||
|
||
- Lets us know when a status check didn't succeed (failure or cancel) | ||
- Lets us know when a status check didn't succeed | ||
- If all jobs were successful, we'll send a message at the end | ||
|
||
> Note that the status variable is omitted here. | ||
|
||
```yaml | ||
name: Test | ||
|
@@ -118,12 +120,6 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- run: yarn | ||
- run: yarn test | ||
- uses: iRoachie/[email protected] | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
status: ${{ job.status }} | ||
if: ${{ !success() }} | ||
lint: | ||
name: Eslint | ||
|
@@ -132,21 +128,15 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- run: yarn | ||
- run: yarn lint | ||
- uses: iRoachie/[email protected] | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
status: ${{ job.status }} | ||
if: ${{ !success() }} | ||
notify: | ||
Name: Slack | ||
needs: [test, lint] | ||
needs: [test, lint] # We only check after the others jobs have run | ||
if: always() # Always runs even if one of the builds fails | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: iRoachie/slack-github-actions@v1.1.1 | ||
- uses: iRoachie/slack-github-actions@v2.0.0 | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
status: ${{ job.status }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.