Converts Release Drafter-styled GitHub release notes for a tag into Confluence storage-format HTML, expands PR details (including images), and publishes under a specified parent page. Images from PR bodies are downloaded, attached to the page, and inlined using Confluence attachment macros.
- Expand release notes by PR, including PR body and images
- Generate Confluence storage-format HTML with Expand macros per PR
- Create a Confluence page under a given parent page ID
- Upload local images as attachments and replace
<img>tags with attachment macros - Works on
release.publishedor via manualworkflow_dispatch
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Release Notes To Confluence
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Tag (e.g. v1.2.3) to publish"
required: true
type: string
jobs:
release-notes-to-confluence:
name: Release Notes To Confluence
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tractorzoom/action-release-notes-to-confluence@v1
with:
tag: ${{ inputs.tag || github.event.release.tag_name }}
confluence-api-token: ${{ secrets.CONFLUENCE_API_TOKEN }}
confluence-base-url: ${{ secrets.CONFLUENCE_BASE_URL }}
confluence-email: ${{ secrets.CONFLUENCE_EMAIL }}
confluence-space-key: ${{ secrets.CONFLUENCE_SPACE_KEY }}
confluence-parent-page-id: ${{ secrets.CONFLUENCE_PARENT_PAGE_ID }}
confluence-page-title-format: 'Release Notes for ${tag}'Notes:
- If
tagis omitted, the action infers it from thereleaseevent payload. - Outputs:
confluence-page-idconfluence-page-url
tag: Release tag (optional when triggered by release event)github-token: GitHub token (defaults togithub.token)confluence-api-token(required)confluence-base-url(required) e.g.https://your-domain.atlassian.net/wikiconfluence-email(required)confluence-space-key(required)confluence-parent-page-id(required)confluence-page-title-format(optional) supports${tag}and${releaseName}
This action is implemented in TypeScript and targets Node 20. Build artifacts are emitted to dist/.
Commands:
- Install:
yarn[[memory:6394627]] - Build:
yarn build - Dev (watch):
yarn dev
You can run the action locally with a helper script:
- Copy
examples/env.local.exampleto.env.localand fill values (GitHub PAT, Confluence creds, repo owner/name, tag). - Build once:
yarn build[[memory:6394627]]
- Run:
yarn local -- --owner your-github-owner --repo your-repo --tag v1.2.3
Notes:
- The script maps inputs to env vars like the GitHub runner (e.g.,
INPUT_CONFLUENCE_API_TOKEN). - If you pass
--tag, it overrides theTAGvalue in.env.local. - All required inputs also fall back to environment variables:
CONFLUENCE_API_TOKEN,CONFLUENCE_BASE_URL,CONFLUENCE_EMAIL,CONFLUENCE_SPACE_KEY,CONFLUENCE_PARENT_PAGE_ID, and optionalCONFLUENCE_PAGE_TITLE_FORMAT.
- Outputs
confluence-page-idandconfluence-page-urlin the action logs.
- Fetches the release by tag and parses categories and PR references from Release Drafter output (
- ... (#123)). - Fetches each PR body, normalizes relative image links to the PR commit SHA, downloads images, and rewrites references to local
./assets/...paths. - Produces Confluence storage-format HTML using Expand macros per PR.
- Creates a Confluence page under the provided parent ID.
- Uploads local images as page attachments and updates the page to use Confluence attachment macros for inline rendering.