Skip to content

Commit

Permalink
Merge pull request #92 from NJUPT-SAST/deploy
Browse files Browse the repository at this point in the history
Update github action
  • Loading branch information
Xunop authored Jul 17, 2024
2 parents af37467 + f2de6da commit 4adc741
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ jobs:
fi
# Load the new image and run it
# It will failed, for test
docker load -i ~/image.tar
docker load -i /tmp/image.tar
docker run -d --name sastlink -p 8080:8080 sast/sast-link
- name: Send Success Message
if: ${{ success() }}
run: |
bash ./scripts/webhook.sh \
-u "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-u "${{ github.event.pull_request.html_url }}" \
-w ${{ secrets.WEBHOOK_URL }} \
-s sastlink -c "${{ github.event.pull_request.user.login }}" -f 'success' \
-m "https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
Expand All @@ -76,7 +76,7 @@ jobs:
if: ${{ failure() }}
run: |
bash ./scripts/webhook.sh \
-u "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-u "${{ github.event.pull_request.html_url }}" \
-w ${{ secrets.WEBHOOK_URL }} \
-s sastlink -c "${{ github.event.pull_request.user.login }}" -f 'failure' \
-m "https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
8 changes: 4 additions & 4 deletions scripts/webhook.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

usage() {
echo "Usage: $0 [-u <workflow_url>] [-w <webhook_url>] [-s <service_name>] [-c <commit_user>] [-m <commit_url>] [-f <flow_status>]" 1>&2
echo "Usage: $0 [-u <pr_url>] [-w <webhook_url>] [-s <service_name>] [-c <commit_user>] [-m <commit_url>] [-f <flow_status>]" 1>&2
exit 1
}

Expand All @@ -11,7 +11,7 @@ while getopts "hu:w:s:c:m:f:" arg; do
usage
;;
u)
workflow_url="$OPTARG"
pr_url="$OPTARG"
;;
w)
webhook_url="$OPTARG"
Expand All @@ -34,7 +34,7 @@ while getopts "hu:w:s:c:m:f:" arg; do
esac
done

if [[ -z "$workflow_url" || -z "$webhook_url" || -z "$service_name" || -z "$commit_user" || -z "$commit_url" || -z "$flow_status" ]]; then
if [[ -z "$pr_url" || -z "$webhook_url" || -z "$service_name" || -z "$commit_user" || -z "$commit_url" || -z "$flow_status" ]]; then
usage
exit 1
fi
Expand Down Expand Up @@ -67,7 +67,7 @@ card_msg='{
"content": "see details",
"tag": "lark_md"
},
"url": "'$workflow_url'",
"url": "'$pr_url'",
"type": "default",
"value": {}
}],
Expand Down

0 comments on commit 4adc741

Please sign in to comment.