Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions agent/server/snykbroker/accept_files/accept.github.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
"method": "any",
"path": "/*",
"origin": "${GITHUB:github.com}",
"auth": {
"scheme": "basic",
"username": "github",
"password": "${plugin:github-app-token}"
"headers": {
"Authorization": "Basic ${plugin:github-app-scaffolder}"
},
"valid": [
{
Expand Down Expand Up @@ -43,3 +41,4 @@
}
]
}

22 changes: 22 additions & 0 deletions agent/server/snykbroker/plugins/github-app-scaffolder
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/bash

set -euo pipefail

echo_to_stderr() {
echo "$1" >&2
}

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo_to_stderr "Fetching GitHub installation token..."

# Execute github-app-token and capture output
if ! token=$("${SCRIPT_DIR}/github-app-token"); then
echo "Error: Failed to get GitHub installation token" >&2
exit 1
fi

echo_to_stderr "Converting GitHub installation token for scaffolder"

echo -n "x-cortex-user:${token}" | base64

Loading