Skip to content
Snippets Groups Projects

feat: demo posting PR comment

Closed Wouter Deconinck requested to merge post-pr-comment into main
1 file
+ 24
3
Compare changes
  • Side-by-side
  • Inline
+ 24
3
@@ -47,6 +47,29 @@ stages:
@@ -47,6 +47,29 @@ stages:
done ;
done ;
fi
fi
 
.report:
 
image: curlimages/curl:latest
 
before_script: []
 
script:
 
- |
 
if [ -n "${GITHUB_PR}" ] ; then
 
BODY=$(
 
echo "<details><summary>geoviewer</summary>" ;
 
for config in ${DETECTOR_CONFIG//,/ } ; do
 
url=${TARGET_URL/%config%/${config}} ;
 
echo "- [$config]($url)" ;
 
done ;
 
echo "</details>" ;
 
) ;
 
curl \
 
-X POST \
 
-H "Accept: application/vnd.github+json" \
 
-H "Authorization: token ${GITHUB_REPO_STATUS_TOKEN}" \
 
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${GITHUB_PR}/comments" \
 
-d '{"body":"'"${BODY}"'"}' ;
 
fi
 
 
geoviewer:pending:
geoviewer:pending:
stage: status-pending
stage: status-pending
extends: .status
extends: .status
@@ -105,10 +128,8 @@ convert:
@@ -105,10 +128,8 @@ convert:
report:
report:
stage: finish
stage: finish
 
extends: .report
needs: ["convert"]
needs: ["convert"]
script:
- echo "It was a success!"
allow_failure: true
geoviewer:success:
geoviewer:success:
stage: status-report
stage: status-report
Loading