Skip to content

Commit 0478a60

Browse files
committed
reference payload as env
1 parent d81ac57 commit 0478a60

File tree

14 files changed

+38
-33
lines changed

14 files changed

+38
-33
lines changed

.github/actions/old_post-log-to-slack/package.json

-14
This file was deleted.

.github/actions/post-log-to-slack/action.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# action.yml
12
name: 'Hello World'
23
description: 'Greet someone and record the time'
34
inputs:
@@ -9,5 +10,8 @@ outputs:
910
time: # id of output
1011
description: 'The time we greeted you'
1112
runs:
12-
using: 'node20'
13-
main: 'index.js'
13+
using: 'docker'
14+
image: 'Dockerfile'
15+
env:
16+
GITHUB_CONTEXT: ${{ toJson(github) }}
17+
VARS_CONTEXT: ${{ toJson(vars) }}

.github/actions/old_post-log-to-slack/index.ts .github/actions/post-log-to-slack/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ const token = process.env.SLACK_TOKEN;
44

55
const web = new WebClient(token);
66

7+
const text = `Hello from github action! ${process.env.GITHUB_CONTEXT}, ${process.env.VARS_CONTEXT}`;
8+
9+
console.log(text);
10+
711
web.chat.postMessage({
812
channel: "nais-test-announcements",
9-
text: "Hello from github action!",
13+
text,
1014
});
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
{
22
"name": "post-log-to-slack",
3-
"version": "1.0.0",
4-
"main": "index.js",
5-
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1"
3+
"module": "index.ts",
4+
"type": "module",
5+
"devDependencies": {
6+
"@types/bun": "latest"
7+
},
8+
"peerDependencies": {
9+
"typescript": "^5.0.0"
710
},
8-
"keywords": [],
9-
"author": "",
10-
"license": "ISC",
11-
"description": "",
1211
"dependencies": {
13-
"@actions/core": "^1.11.1",
14-
"@actions/github": "^6.0.0",
1512
"@slack/web-api": "^7.7.0"
1613
}
17-
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# action.yml
21
name: 'Hello World'
32
description: 'Greet someone and record the time'
43
inputs:
@@ -10,7 +9,5 @@ outputs:
109
time: # id of output
1110
description: 'The time we greeted you'
1211
runs:
13-
using: 'docker'
14-
image: 'Dockerfile'
15-
args:
16-
- ${{ inputs.who-to-greet }}
12+
using: 'node20'
13+
main: 'index.js'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "post-log-to-slack",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1"
7+
},
8+
"keywords": [],
9+
"author": "",
10+
"license": "ISC",
11+
"description": "",
12+
"dependencies": {
13+
"@actions/core": "^1.11.1",
14+
"@actions/github": "^6.0.0",
15+
"@slack/web-api": "^7.7.0"
16+
}
17+
}

0 commit comments

Comments
 (0)