Comment on a Vikunja task
- Shell 100%
|
All checks were successful
Lint / shellcheck (push) Successful in 2s
The contains() check matched /issues/7 against /issues/70 because it does plain substring matching. Now uses split() with a boundary check to verify the reference is followed by a non-digit character or end of string. Prevents commenting on the wrong task when one issue number is a prefix of another. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| action.yml | ||
| CLAUDE.md | ||
| entrypoint.sh | ||
| README.md | ||
vikunja-comment
A Forgejo action that adds a comment to a Vikunja task. Works by explicit task ID or by searching for a linked reference in the description.
Usage
Comment by task ID
- uses: actions/vikunja-comment@main
with:
task-id: ${{ steps.find.outputs.task-id }}
comment: "PR merged by ${{ github.actor }}: ${{ github.event.pull_request.html_url }}"
api-url: ${{ secrets.VIKUNJA_API_URL }}
api-token: ${{ secrets.VIKUNJA_API_TOKEN }}
Comment by reference (cross-workflow)
- uses: actions/vikunja-comment@main
with:
reference: "${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.issue.number }}"
project: ${{ secrets.VIKUNJA_PROJECT }}
comment: "Build passed on commit ${{ github.sha }}"
api-url: ${{ secrets.VIKUNJA_API_URL }}
api-token: ${{ secrets.VIKUNJA_API_TOKEN }}
CI status updates
- uses: actions/vikunja-comment@main
with:
reference: "${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.issue.number }}"
project: ${{ secrets.VIKUNJA_PROJECT }}
comment: |
Deploy to production complete.
Commit: ${{ github.sha }}
Actor: ${{ github.actor }}
Workflow: ${{ github.workflow }}
api-url: ${{ secrets.VIKUNJA_API_URL }}
api-token: ${{ secrets.VIKUNJA_API_TOKEN }}
Inputs
| Input | Required | Description |
|---|---|---|
task-id |
No* | Explicit task ID to comment on |
reference |
No* | Forgejo URL or short ref to search for in task descriptions |
project |
No | Project name to scope the reference search |
comment |
Yes | The comment text to add |
api-url |
Yes | Vikunja base URL |
api-token |
Yes | Vikunja API token |
*Must provide either task-id or reference.
Outputs
| Output | Description |
|---|---|
task-id |
Numeric ID of the commented task |
task-url |
Full URL to the task in the Vikunja web UI |
comment-id |
Numeric ID of the created comment |
Secret cascade
api-url: ${{ secrets.VIKUNJA_API_URL }} # set once at org level
api-token: ${{ secrets.VIKUNJA_API_TOKEN }} # set once at org level
project: ${{ secrets.VIKUNJA_PROJECT }} # override per org or repo
Requirements
Runners must have curl, jq, bash, and git available.