File tree Expand file tree Collapse file tree 4 files changed +28
-10
lines changed Expand file tree Collapse file tree 4 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 5
5
name : Lint
6
6
runs-on : ubuntu-latest
7
7
steps :
8
- - name : Set up Python 3.10
9
- uses : actions/setup-python@v1
8
+ - name : Set up Python 3.12
9
+ uses : actions/setup-python@v5
10
10
with :
11
- python-version : " 3.10 "
11
+ python-version : " 3.12 "
12
12
13
- - uses : actions/checkout@v1
13
+ - uses : actions/checkout@v4
14
14
15
15
- name : Lint
16
16
run : |
Original file line number Diff line number Diff line change 20
20
runs-on : ubuntu-latest
21
21
name : POST Webhook
22
22
steps :
23
- - uses : actions/checkout@v1
23
+ - uses : actions/checkout@v4
24
+ - name : run hook directly
25
+ if : |
26
+ github.repository_owner == 'openziti'
27
+ && ((github.event_name != 'pull_request_review')
28
+ || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved'))
29
+ env :
30
+ INPUT_ZITIID : ${{ secrets.ZITI_MATTERMOST_IDENTITY }}
31
+ INPUT_WEBHOOKURL : ${{ secrets.ZHOOK_URL }}
32
+ INPUT_EVENTJSON : ${{ toJson(github.event) }}
33
+ INPUT_SENDERUSERNAME : GitHubZ
34
+ INPUT_DESTCHANNEL : dev-notifications
35
+ INPUT_SENDERICONURL : https://github.com/fluidicon.png
36
+ run : |
37
+ pip install --upgrade requests openziti
38
+ python ./zhook.py
39
+
40
+
24
41
- uses : ./ # use self to bring the pain forward
42
+ name : run action
25
43
if : |
26
44
github.repository_owner == 'openziti'
27
45
&& ((github.event_name != 'pull_request_review')
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ FROM python:3-slim AS builder
2
2
ADD . /app
3
3
WORKDIR /app
4
4
5
- RUN pip install --target=/app requests openziti==0.7.2
5
+ RUN pip install --target=/app requests openziti
6
6
7
7
# https://github.com/GoogleContainerTools/distroless
8
- FROM gcr.io/distroless/python3-debian10
8
+ FROM gcr.io/distroless/python3-debian12
9
9
COPY --from=builder /app /app
10
10
WORKDIR /app
11
11
ENV PYTHONPATH /app
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def createTitle(self):
86
86
# starCount = self.repoJson["stargazers_count"]
87
87
# starUrl = f"{repoUrl}/stargazers"
88
88
89
- title = f"{ self .eventName .capitalize ().replace ('_' ,' ' )} "
89
+ title = f"{ self .eventName .capitalize ().replace ('_' , ' ' )} "
90
90
91
91
try :
92
92
action = self .eventJson ["action" ]
@@ -344,7 +344,7 @@ def addWatchDetails(self):
344
344
def addDefaultDetails (self ):
345
345
self .attachment ["color" ] = self .todoColor
346
346
self .attachment ["text" ] = self .createTitle ()
347
- self .attachment ["fallback" ] = f"{ eventName .capitalize ().replace ('_' ,' ' )} by { self .senderJson ['login' ]} in { self .repoJson ['full_name' ]} "
347
+ self .attachment ["fallback" ] = f"{ eventName .capitalize ().replace ('_' , ' ' )} by { self .senderJson ['login' ]} in { self .repoJson ['full_name' ]} "
348
348
349
349
def dumpJson (self ):
350
350
return json .dumps (self .body )
@@ -362,9 +362,9 @@ def dumpJson(self):
362
362
363
363
# Setup Ziti identity
364
364
idFilename = "id.json"
365
- os .environ ["ZITI_IDENTITIES" ] = idFilename
366
365
with open (idFilename , 'w' ) as f :
367
366
f .write (zitiId )
367
+ openziti .load (idFilename )
368
368
369
369
# Create webhook body
370
370
try :
You can’t perform that action at this time.
0 commit comments