docs(ci): Front-Matter + CI-Docs + YT-Sync vorbereitet (MP-7)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
name: YouTrack Sync (on merge)
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Comment to YouTrack Issue(s)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
KEYS=$(git log -1 --pretty=%B | grep -o '[A-Z]\+-[0-9]\+' | sort -u || true)
|
||||
if [ -z "$KEYS" ]; then
|
||||
echo "No issue keys in last commit message. Skipping."
|
||||
exit 0
|
||||
fi
|
||||
for ISSUE in $KEYS; do
|
||||
MSG=$(printf 'PR/Commit gemergt: %s\nRepo: %s\nCommit: %s' "${{ github.event.head_commit.url }}" "${{ github.repository }}" "${{ github.sha }}")
|
||||
curl -sS -X POST \
|
||||
-H "Authorization: Bearer $YT_TOKEN" \
|
||||
-H "Accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
"$YT_URL/api/issues/$ISSUE/comments" \
|
||||
-d "{\"text\": \"$MSG\"}"
|
||||
done
|
||||
env:
|
||||
YT_URL: ${{ secrets.YT_URL }}
|
||||
YT_TOKEN: ${{ secrets.YT_TOKEN }}
|
||||
Reference in New Issue
Block a user