Skip to content

Commit

Permalink
Add .github folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Hourunze1997 committed Dec 26, 2024
1 parent fa2b5c6 commit 87e2f9a
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 1 deletion.
84 changes: 84 additions & 0 deletions .github/script/scan_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

IAM_DATA=$(cat <<EOF
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"domain": {
"name": "freesky-edward"
},
"name": "codearts_test",
"password": "$3"
}
}
},
"scope": {
"project": {
"name": "cn-north-4"
}
}
}
}
EOF
)

response=$(curl -s -i --location 'https://iam.myhuaweicloud.com/v3/auth/tokens?nocatalog=true' \
--header 'Content-Type: application/json' \
--data "$IAM_DATA")

# Extract the X-Subject-Token from the response
token=$(echo "$response" | grep "X-Subject-Token" | awk '{print $2}' | tr -d '\r')

echo "X-Subject-Token: $token"


DATA=$(cat <<EOF
{
"sources" : [ {
"type" : "code",
"params" : {
"git_type" : "github",
"default_branch" : "main",
"git_url" : "$6",
"endpoint_id" : "$5",
"build_params" : {
"build_type" : "branch",
"event_type" : "Manual",
"target_branch" : "$1"
}
}
} ],
"description" : "运行描述",
"variables" : [ {
"name" : "repo",
"value" : "$8"
} ,
{
"name" : "owner",
"value" : "$7"
}
,
{
"name" : "pr_id",
"value" : "$2"
}
,
{
"name" : "imageUrl",
"value" : "$9"
}
]
}
EOF
)

CODEARTS_PIPELINE="$4"

curl --location "$CODEARTS_PIPELINE" \
--header "X-Auth-Token:$token" \
--header "Content-Type: application/json" \
--data "$DATA"
7 changes: 6 additions & 1 deletion .github/workflows/gate-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ name: Gate Check

on:
pull_request:
types: [opened, synchronize, reopened] # 在PR打开、同步、重新打开时触发
types: [opened, synchronize, reopened]
# 在PR打开、同步、重新打开时触发
branches:
- main
- master
- release/*

jobs:
codearts-check:
Expand Down

0 comments on commit 87e2f9a

Please sign in to comment.