Skip to content

Commit d6be60b

Browse files
authored
Merge pull request #13 from unacast/add_log_url
Add log_url when creating deployment status
2 parents cfa1b78 + a0327e9 commit d6be60b

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,3 @@ jobs:
1818
args: bin/deployment-create-status bin/deployment-get-id
1919
- name: Docker build
2020
run: docker build -t actions-github-deployment-status .
21-
22-
gh-tagged-release:
23-
name: Tagged release
24-
needs: test
25-
runs-on: ubuntu-latest
26-
27-
steps:
28-
- name: Checkout source code
29-
uses: actions/checkout@v2
30-
31-
- name: Check Tag
32-
id: check-tag
33-
run: |
34-
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
35-
echo ::set-output name=match::true
36-
fi
37-
38-
- name: Create Release
39-
uses: "marvinpinto/[email protected]"
40-
if: steps.check-tag.outputs.match == 'true'
41-
with:
42-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
43-
prerelease: false

.github/workflows/versioning.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

bin/deployment-create-status

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,19 @@ set -e
1111

1212
BASEDIR=$(dirname "$0")
1313
DEPLOYMENT_ID=$("${BASEDIR}"/deployment-get-id)
14+
GITHUB_WORKFLOW_URL=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
1415

1516
DEPLOY_STATE=$(echo "${1}"|tr "[:upper:]" "[:lower:]")
1617
DEPLOY_DESC="${2}"
1718

18-
if [ "$DEPLOY_STATE" = "cancelled" ]; then
19-
DEPLOY_STATE="inactive"
20-
ACCEPT_HEADER="application/vnd.github.ant-man-preview+json"
21-
else
22-
ACCEPT_HEADER="application/vnd.github.flash-preview+json"
23-
fi
24-
25-
ACCEPT_HEADER="application/vnd.github.flash-preview+json"
19+
ACCEPT_HEADER="application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json"
2620

2721

2822
[ -n "${DEPLOY_DESC}" ] || DEPLOY_DESC="Deploying from GitHub Actions"
2923

3024
echo "Setting status to ${DEPLOY_STATE} for deployment-id '${DEPLOYMENT_ID}'"
3125
wget -O-- \
32-
--post-data "{\"state\":\"${DEPLOY_STATE}\", \"target_url\":\"https://github.com/${GITHUB_REPOSITORY}/actions\", \"description\":\"${DEPLOY_DESC}\"}" \
26+
--post-data "{\"state\":\"${DEPLOY_STATE}\", \"target_url\":\"https://github.com/${GITHUB_REPOSITORY}/actions\", \"description\":\"${DEPLOY_DESC}\", \"log_url\":\"${GITHUB_WORKFLOW_URL}\"}" \
3327
--header "Authorization: token ${INPUT_GITHUB_TOKEN}" \
3428
--header "Content-Type: text/json; charset=utf-8" \
3529
--header "Accept: ${ACCEPT_HEADER}" \

0 commit comments

Comments
 (0)