navicore / teams-notification-resource

for Concourse CI notifications on Microsoft Teams
MIT License
32 stars 34 forks source link

set content-type on webhook curl request #38

Closed rcousineau-xandr closed 1 year ago

rcousineau-xandr commented 1 year ago

Fixes #36

Note: I was unable to run docker build to test this change because of:

------
 > http://stedolan.github.io/jq/download/linux64/jq:
------
ERROR: failed to solve: failed to load cache key: invalid response status 404

but instead of doing:

ADD http://stedolan.github.io/jq/download/linux64/jq /usr/local/bin/jq

I think jq can just be installed with apt. Happy to include that change in the PR as well!

rcousineau-xandr commented 1 year ago

For what it's worth, using a build from this fork did resolve the issue and I'm able to send Teams notifications. 🎉

rcousineau-xandr commented 1 year ago

Proposed Dockerfile changes (I can include this in the PR if you'd like):

diff --git a/Dockerfile b/Dockerfile
index b87bff0..db4c50e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,11 @@
 FROM ubuntu:22.04

-ADD http://stedolan.github.io/jq/download/linux64/jq /usr/local/bin/jq
+# ADD http://stedolan.github.io/jq/download/linux64/jq /usr/local/bin/jq

 COPY check /opt/resource/check
 COPY in    /opt/resource/in
 COPY out   /opt/resource/out

-RUN chmod +x /usr/local/bin/jq /opt/resource/out /opt/resource/in /opt/resource/check && \
+RUN chmod +x /opt/resource/out /opt/resource/in /opt/resource/check && \
     apt-get update && \
-    DEBIAN_FRONTEND=noninteractive apt-get install -y curl
-
+    DEBIAN_FRONTEND=noninteractive apt-get install -y curl jq
navicore commented 1 year ago

thx!

rcousineau-xandr commented 1 year ago

@navicore thanks so much for getting that merged so quickly! ❤️