Skip to content

Commit b38234e

Browse files
committed
added env for token in slack notification workflow
1 parent e8088e1 commit b38234e

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

.github/workflows/rtconnect-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node and various OS (Windows, Ubuntu)
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

44
name: RTConnect CI

.github/workflows/slack-notify.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
name: Slack Notification of CI Status
22

33
on:
4-
push:
5-
branches: ["main", "feature/raisa-cicd"]
6-
pull_request:
7-
branches: ["main"]
8-
4+
push:
5+
branches: ["main", "feature/raisa-cicd"]
6+
pull_request:
7+
branches: ["main"]
8+
env:
9+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} # This works BUT it shows up as problem for some unknown reason ("Context access might be invalid: NPM_TOKEN") and there should not be any errors
10+
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
911
jobs:
10-
slackNotification:
11-
name: Slack CI status - notify on failure
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Slack Notify on Failure
15-
if: ${{ failure() }}
16-
id: slack
17-
uses: slackapi/slack-github-action@v1.24.0
18-
with:
19-
channel-id: 'C067F896WG5'
20-
slack-message: "Github CI Result: ${{ job.status }}\nGithub PR/Commit URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
21-
env:
22-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} # This works BUT it shows up as problem for some unknown reason ("Context access might be invalid: NPM_TOKEN") and there should not be any errors
23-
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
24-
12+
slackNotification:
13+
runs-on: ubuntu-latest
14+
name: Slack CI status - notify on failure
15+
steps:
16+
- name: Slack Notify on Failure
17+
if: ${{ failure() }}
18+
id: slack
19+
uses: slackapi/slack-github-action@v1.24.0
20+
with:
21+
channel-id: 'C067F896WG5'
22+
slack-message: "Github CI Result: ${{ job.status }}\nGithub PR/Commit URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
2523

2624
# https://github.com/slackapi/slack-github-action

0 commit comments

Comments
 (0)