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

Update github action #92

Merged
merged 1 commit into from
Jul 17, 2024
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
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
Loading