generated from cds-snc/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (75 loc) · 3.24 KB
/
test_chained_actions_sentinel_forward.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Test forward github action data to Sentinel
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
generate-data-from-another-action:
runs-on: ubuntu-latest
outputs:
file_name: ${{ steps.step1.outputs.file_name}}
output_data: ${{ steps.step2.outputs.input_data}}
log_type: ${{ steps.step3.outputs.log_type}}
steps:
- id: step1
run: echo "file_name=/app/src/tests/data/test_file.txt" >> $GITHUB_OUTPUT
- id: step2
run: echo "input_data=Sample output that is to be sent to Sentinel" >> $GITHUB_OUTPUT
- id: step3
run: echo "log_type=TestGithubAction_CL" >> $GITHUB_OUTPUT
send-data-to-sentinel:
runs-on: ubuntu-latest
needs: generate-data-from-another-action
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Test chained actions
id: selftest
uses: ./
with:
file_name: ${{ needs.generate-data-from-another-action.outputs.file_name }}
input_data: ${{ needs.generate-data-from-another-action.outputs.output_data }}
log_type: ${{ needs.generate-data-from-another-action.outputs.log_type}}
log_analytics_workspace_id: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }}
log_analytics_workspace_key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}
send-data-to-sentinel_json:
runs-on: ubuntu-latest
needs: [generate-data-from-another-action, send-data-to-sentinel]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Test action sending .json file on 1 line
id: selftest_json
uses: ./
with:
file_name: "/app/src/tests/data/test_file.json"
log_type: ${{ needs.generate-data-from-another-action.outputs.log_type}}
log_analytics_workspace_id: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }}
log_analytics_workspace_key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}
send-data-to-sentinel_json_multiline:
runs-on: ubuntu-latest
needs: [generate-data-from-another-action, send-data-to-sentinel_json]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Test action sending .json on multiple lines
id: selftest_json_multiline
uses: ./
with:
file_name: /app/src/tests/data/test_file_muline.json
log_type: ${{ needs.generate-data-from-another-action.outputs.log_type}}
log_analytics_workspace_id: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }}
log_analytics_workspace_key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}
send-data-to-sentinel_jsonl:
runs-on: ubuntu-latest
needs: [generate-data-from-another-action, send-data-to-sentinel_json_multiline]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Test action sending .jsonl
id: selftest_jsonl
uses: ./
with:
file_name: "/app/src/tests/data/test_file.jsonl"
log_type: ${{ needs.generate-data-from-another-action.outputs.log_type}}
log_analytics_workspace_id: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }}
log_analytics_workspace_key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}