Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .github folder structure #298

Closed
wants to merge 2 commits into from
Closed
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
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
Loading