Skip to content

Commit e05fb55

Browse files
authored
Merge pull request #111 from tarosky/feature/watchtower-notify-slug-110
watchtower-notify に slug input を追加 (#110)
2 parents 6199286 + 15493cf commit e05fb55

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/watchtower-notify.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
description: OIDC token の audience(watchtower 側 WATCHTOWER_OIDC_AUDIENCE と一致させる)
1515
type: string
1616
default: watchtower
17+
slug:
18+
description: |
19+
プラグイン slug(シート H列)。リポ名と異なる / monorepo の場合に指定。
20+
未指定ならリポ名(repository クレーム由来)が使われる。
21+
type: string
22+
default: ''
1723

1824
jobs:
1925
notify:
@@ -27,6 +33,7 @@ jobs:
2733
ENDPOINT: ${{ inputs.endpoint }}
2834
AUDIENCE: ${{ inputs.audience }}
2935
VERSION: ${{ github.event.release.tag_name }}
36+
SLUG: ${{ inputs.slug }}
3037
run: |
3138
set -euo pipefail
3239
@@ -42,7 +49,12 @@ jobs:
4249
4350
# 2. watchtower へ通知。プラグイン名はトークンの repository クレームから
4451
# watchtower 側で導出されるため、body には version(tag) だけ送る。
45-
PAYLOAD=$(jq -nc --arg v "$VERSION" '{version:$v}')
52+
# slug を指定した場合(リポ名 ≠ プラグイン slug / monorepo)は body に含める。
53+
if [ -n "$SLUG" ]; then
54+
PAYLOAD=$(jq -nc --arg v "$VERSION" --arg s "$SLUG" '{version:$v, slug:$s}')
55+
else
56+
PAYLOAD=$(jq -nc --arg v "$VERSION" '{version:$v}')
57+
fi
4658
HTTP_CODE=$(curl -sS -o /tmp/resp.json -w '%{http_code}' \
4759
-X POST "$ENDPOINT" \
4860
-H "Authorization: Bearer $TOKEN" \

0 commit comments

Comments
 (0)