diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 2644d79..a89759b 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -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 }}" @@ -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 }}" diff --git a/scripts/webhook.sh b/scripts/webhook.sh index 995400f..1b1ccd3 100644 --- a/scripts/webhook.sh +++ b/scripts/webhook.sh @@ -1,7 +1,7 @@ #!/bin/bash usage() { - echo "Usage: $0 [-u ] [-w ] [-s ] [-c ] [-m ] [-f ]" 1>&2 + echo "Usage: $0 [-u ] [-w ] [-s ] [-c ] [-m ] [-f ]" 1>&2 exit 1 } @@ -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" @@ -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 @@ -67,7 +67,7 @@ card_msg='{ "content": "see details", "tag": "lark_md" }, - "url": "'$workflow_url'", + "url": "'$pr_url'", "type": "default", "value": {} }],