Files
actions/create-issue/action.yaml
Hugo Nijhuis 17b45c7753 Update URLs from code.flowmade.one to git.flowmade.one
Migrate all action files to use the new Gitea server URL.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 00:30:07 +01:00

74 lines
2.0 KiB
YAML

name: Create Issue
description: Create an issue via Forgejo API
inputs:
token:
description: Forgejo API token
required: true
repository:
description: Repository (owner/repo)
default: ${{ github.repository }}
title:
description: Issue title
required: true
body:
description: Issue body
default: ''
labels:
description: Comma-separated label names
default: ''
assignees:
description: Comma-separated usernames to assign
default: ''
outputs:
number:
description: Created issue number
value: ${{ steps.create.outputs.number }}
url:
description: Issue URL
value: ${{ steps.create.outputs.url }}
runs:
using: composite
steps:
- id: create
shell: bash
run: |
TOKEN="${{ inputs.token }}"
REPO="${{ inputs.repository }}"
TITLE="${{ inputs.title }}"
BODY="${{ inputs.body }}"
LABELS="${{ inputs.labels }}"
ASSIGNEES="${{ inputs.assignees }}"
# Build JSON payload
JSON=$(jq -n \
--arg title "$TITLE" \
--arg body "$BODY" \
'{title: $title, body: $body}')
# Add labels if provided
if [ -n "$LABELS" ]; then
LABELS_JSON=$(echo "$LABELS" | tr ',' '\n' | jq -R . | jq -s .)
JSON=$(echo "$JSON" | jq --argjson labels "$LABELS_JSON" '. + {labels: $labels}')
fi
# Add assignees if provided
if [ -n "$ASSIGNEES" ]; then
ASSIGNEES_JSON=$(echo "$ASSIGNEES" | tr ',' '\n' | jq -R . | jq -s .)
JSON=$(echo "$JSON" | jq --argjson assignees "$ASSIGNEES_JSON" '. + {assignees: $assignees}')
fi
RESPONSE=$(curl -s -X POST \
"https://git.flowmade.one/api/v1/repos/$REPO/issues" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "$JSON")
NUMBER=$(echo "$RESPONSE" | jq -r '.number')
URL=$(echo "$RESPONSE" | jq -r '.html_url')
echo "number=$NUMBER" >> $GITHUB_OUTPUT
echo "url=$URL" >> $GITHUB_OUTPUT