Add reusable Forgejo Actions
Composite actions for CI/CD workflows: - checkout: Clone repo with configurable depth - docker-build: Build Docker images with multiple tags - docker-push: Push to Forgejo Packages registry - create-tag: Auto-increment semantic version tags - create-issue: Create issues via Forgejo API - create-pr: Create pull requests via Forgejo API - comment-pr: Add comments to PRs via Forgejo API All actions use shell scripts (no Node.js required). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
43
comment-pr/action.yaml
Normal file
43
comment-pr/action.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Comment on PR
|
||||
description: Add a comment to a pull request via Forgejo API
|
||||
|
||||
inputs:
|
||||
token:
|
||||
description: Forgejo API token
|
||||
required: true
|
||||
repository:
|
||||
description: Repository (owner/repo)
|
||||
default: ${{ github.repository }}
|
||||
pr-number:
|
||||
description: Pull request number
|
||||
required: true
|
||||
body:
|
||||
description: Comment body
|
||||
required: true
|
||||
|
||||
outputs:
|
||||
id:
|
||||
description: Created comment ID
|
||||
value: ${{ steps.comment.outputs.id }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- id: comment
|
||||
shell: bash
|
||||
run: |
|
||||
TOKEN="${{ inputs.token }}"
|
||||
REPO="${{ inputs.repository }}"
|
||||
PR_NUMBER="${{ inputs.pr-number }}"
|
||||
BODY="${{ inputs.body }}"
|
||||
|
||||
JSON=$(jq -n --arg body "$BODY" '{body: $body}')
|
||||
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
"https://code.flowmade.one/api/v1/repos/$REPO/issues/$PR_NUMBER/comments" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$JSON")
|
||||
|
||||
ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||
echo "id=$ID" >> $GITHUB_OUTPUT
|
||||
Reference in New Issue
Block a user