Skip to content

Commit

Permalink
lib: update github status message
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine committed Sep 24, 2023
1 parent adea1ab commit 26cd6db
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/github/mkGithubStatus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@ in {
build=$(echo "$input" | jq '.input.build' -r)
data=$(echo "$input" | jq '.input.data' -r)
evaluation=$(echo "$input" | jq '.input.evaluation' -r)
flake_locked=$(echo "$input" | jq '.input.flake_locked' -r)
job=$(echo "$input" | jq '.input.job' -r)
jobset=$(echo "$input" | jq '.input.jobset' -r)
project=$(echo "$input" | jq '.input.project' -r)
status=$(echo "$input" | jq '.input.status' -r)
token=$(echo "$input" | jq '.secrets.github_token' -r)
rev=$(echo "$flake_locked" | sed 's/github:.*\/.*\/\(.*\)/\1/')
target_url="$(echo "$data" | jq '.url' -r)/builds/$build"
context="Typhon: $job"
description="$project:$jobset:$evaluation:$job"
context="Typhon: ${system} / $job"
case $status in
"error")
state="failure"
Expand All @@ -56,7 +52,7 @@ in {
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $token" \
"https://api.github.com/repos/${owner}/${repo}/statuses/$rev" \
-d "{\"state\":\"$state\",\"target_url\":\"$target_url\",\"description\":\"$description\",\"context\":\"$context\"}" \
-d "{\"state\":\"$state\",\"target_url\":\"$target_url\",\"description\":null,\"context\":\"$context\"}" \
-k >&2
'';
});
Expand Down

0 comments on commit 26cd6db

Please sign in to comment.