PHPackages                             fof/extension-releases - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fof/extension-releases

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

fof/extension-releases
======================

Automated extension release updates

2.x-dev(2mo ago)07↓75%MITPHPCI passing

Since Feb 24Pushed 2mo agoCompare

[ Source](https://github.com/FriendsOfFlarum/extension-releases)[ Packagist](https://packagist.org/packages/fof/extension-releases)[ Fund](https://opencollective.com/fof)[ RSS](/packages/fof-extension-releases/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

FoF Extension Releases
======================

[](#fof-extension-releases)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/3c947c3c506102aced29b35b6dca0d33dbaa5391b6357038f275c7127bd8148f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f662f657874656e73696f6e2d72656c65617365732e737667)](https://packagist.org/packages/fof/extension-releases) [![Total Downloads](https://camo.githubusercontent.com/a8a9efd2cd38c1d7366a82fee3a535752849ab2fa5f9f349a55bcbbd6acde153/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666f662f657874656e73696f6e2d72656c65617365732e737667)](https://packagist.org/packages/fof/extension-releases)

A [Flarum](https://flarum.org) 2.0 extension that automatically posts release notifications to discussions when you publish a new GitHub or GitLab release.

Features
--------

[](#features)

- 🚀 Automatic release notifications posted to Flarum discussions
- 🔐 Secure webhook endpoint with Flarum API token authentication (Authorization header)
- ✅ Full test coverage (unit and integration tests)
- 🔧 Support for both GitHub Actions and GitLab CI/CD
- ✅ Auto-approves posts when flarum/approval is enabled

Installation
------------

[](#installation)

Install with composer:

```
composer require fof/extension-releases
```

Then enable the extension in your Flarum admin panel.

Configuration
-------------

[](#configuration)

### Step 1: Generate a Flarum API Token

[](#step-1-generate-a-flarum-api-token)

You need an API token for the user who will post the release notifications:

**Prerequisites:**

- The user must have the **"Create access token"** permission (found in **Permissions** → **Moderate** section)
- The user must have the **"Publish release updates via webhook"** permission (found in **Permissions** → **Start Discussions** section)

**Generate Token:**

1. Log in to Flarum as the user who should post releases (e.g., a bot account)
2. Go to **Settings** → **API Tokens** (or use a REST client)
3. Generate a new API token
4. Copy the token - you'll need it for the webhook configuration

Alternatively, you can generate a token programmatically:

```
# Using the Flarum API
curl -X POST https://your-flarum-site.com/api/token \
  -H "Content-Type: application/json" \
  -d '{
    "identification": "your-username",
    "password": "your-password",
    "lifetime": 31536000
  }'
```

**Note:** Make sure to grant both required permissions to the user in the admin panel before attempting to use the webhook.

### Step 2: Setup GitHub Webhook

[](#step-2-setup-github-webhook)

#### Option A: Using GitHub Actions (Recommended)

[](#option-a-using-github-actions-recommended)

The workflow automatically reads the discussion ID and Flarum URL from your `composer.json` file's `support.forum` field!

**Setup:**

1. Ensure your `composer.json` has the `support.forum` field:

    ```
    {
      "support": {
        "forum": "https://discuss.flarum.org/d/12345-your-extension-discussion"
      }
    }
    ```
2. Add the workflow to your repo: copy `.github/workflows/flarum-release-notification.yml` from this extension, or create it with the same content
3. Add your API token secret:

    - Go to your GitHub repository → **Settings** → **Secrets and variables** → **Actions**
    - Add secret: `FLARUM_EXTENSION_UPDATES_API_TOKEN` with your Flarum API token from Step 2

That's it! The workflow will automatically:

- Extract the discussion ID from `support.forum` in `composer.json`
- Extract the Flarum site URL
- Use the GitHub release body as the changelog
- Post to your discussion whenever you publish a release

#### Option B: Using GitHub Webhooks (Manual)

[](#option-b-using-github-webhooks-manual)

1. Go to your GitHub repository → **Settings** → **Webhooks** → **Add webhook**
2. Configure:
    - **Payload URL**: `https://your-flarum-site.com/api/fof/releases/webhook`
    - **Content type**: `application/json`
    - **Events**: Select "Releases" only
    - **Active**: ✓ Checked

**Note:** Standard GitHub webhooks don't include the API token or discussion ID. You'll need a middleware service or use GitHub Actions instead.

### Step 3: Setup GitLab Webhook

[](#step-3-setup-gitlab-webhook)

#### Option A: Using GitLab CI/CD (Recommended)

[](#option-a-using-gitlab-cicd-recommended)

The pipeline automatically reads the discussion ID and Flarum URL from your `composer.json` file's `support.forum` field!

**Setup:**

1. Ensure your `composer.json` has the `support.forum` field:

    ```
    {
      "support": {
        "forum": "https://discuss.flarum.org/d/12345-your-extension-discussion"
      }
    }
    ```
2. Copy `.gitlab-ci.example.yml` to `.gitlab-ci.yml` in your repository
3. Add your API token variable:

    - Go to your GitLab repository → **Settings** → **CI/CD** → **Variables**
    - Add variable: `FLARUM_EXTENSION_UPDATES_API_TOKEN` with your Flarum API token (mark as protected and masked)

That's it! The pipeline will automatically:

- Extract the discussion ID from `support.forum` in `composer.json`
- Extract the Flarum site URL
- Use the Git tag message as the changelog
- Post to your discussion whenever you create a new tag

#### Option B: Using GitLab Webhooks

[](#option-b-using-gitlab-webhooks)

1. Go to your GitLab repository → **Settings** → **Webhooks**
2. Add webhook:
    - **URL**: `https://your-flarum-site.com/api/fof/releases/webhook`
    - **Trigger**: Check "Releases events"
    - **Enable SSL verification**: ✓ Checked

**Note:** Like GitHub, standard GitLab webhooks require middleware. Use GitLab CI/CD for direct integration.

API Reference
-------------

[](#api-reference)

### Webhook Endpoint

[](#webhook-endpoint)

**POST** `/api/fof/releases/webhook`

**Authentication:** Use Flarum's standard API authentication via the `Authorization` header:

```
Authorization: Token YOUR_FLARUM_EXTENSION_UPDATES_API_TOKEN

```

**Request Body:**

```
{
  "discussion_id": 123,
  "changelog": "## What's Changed\n\n- Fixed bug #42\n- Added new feature",
  "tag_name": "v1.0.0",
  "release_url": "https://github.com/owner/repo/releases/tag/v1.0.0",
  "author": "octocat"
}
```

FieldRequiredDescription`discussion_id`YesDiscussion ID to post to`changelog`YesRelease notes/changelog (Markdown supported)`tag_name`YesVersion tag (e.g., v1.0.0)`release_url`NoURL to the release page`author`NoGitHub/GitLab username of release author**Responses:**

- `201 Created` - Post created successfully

    ```
    {
      "success": true,
      "post_id": 123,
      "post_number": 5
    }
    ```
- `403 Forbidden` - Not authenticated or lacks permission
- `404 Not Found` - Discussion not found
- `422 Unprocessable Entity` - Missing required fields (discussion\_id, changelog, or tag\_name)

Post Format
-----------

[](#post-format)

Release posts use this structure:

```
## 🚀 New Release: {tag_name}

**Author:** {author}
**Release URL:** {release_url}

### Changelog

{changelog}

```

Optional fields (author, release\_url) are omitted when not provided.

Testing
-------

[](#testing)

Run the test suite:

```
# Run all tests
composer test

# Run unit tests only
composer test:unit

# Run integration tests only
composer test:integration

# Setup integration test database (run once)
composer test:setup
```

Troubleshooting
---------------

[](#troubleshooting)

### Webhook returns 401 Unauthorized

[](#webhook-returns-401-unauthorized)

- Verify your API token is valid and hasn't expired
- Ensure the user associated with the token still has an active account

### Webhook returns 403 Forbidden

[](#webhook-returns-403-forbidden)

- Check that the user has permission to reply to the discussion
- Verify the discussion isn't locked

### Posts still require approval (flarum/approval)

[](#posts-still-require-approval-flarumapproval)

This extension creates posts directly (bypassing the API) and sets `is_approved = true`, so webhook posts should not require approval. If they still do, ensure flarum/approval is enabled and the extension is up to date.

### Webhook returns 404 Not Found

[](#webhook-returns-404-not-found)

- Double-check the discussion ID exists
- Ensure the discussion hasn't been deleted

Development
-----------

[](#development)

This extension is built for Flarum 2.0 and follows modern Flarum development practices.

**File Structure:**

```
src/
├── Api/
│   └── Controller/
│       └── ReceiveWebhookController.php
└── Repository/
    └── ReleaseRepository.php
tests/
├── unit/
│   └── Repository/
│       └── ReleaseRepositoryTest.php
└── integration/
    └── Api/
        └── ReceiveWebhookTest.php

```

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/fof/extension-releases)
- [GitHub](https://github.com/fof/extension-releases)
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)
- [Flarum 2.0 Documentation](https://docs.flarum.org/2.x/)

License
-------

[](#license)

MIT License. See [LICENSE.md](LICENSE.md) for details.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance84

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

83d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16573496?v=4)[IanM](/maintainers/imorland)[@imorland](https://github.com/imorland)

---

Top Contributors

[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (3 commits)")[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (2 commits)")

---

Tags

flarum

### Embed Badge

![Health badge](/badges/fof-extension-releases/health.svg)

```
[![Health](https://phpackages.com/badges/fof-extension-releases/health.svg)](https://phpackages.com/packages/fof-extension-releases)
```

###  Alternatives

[fof/byobu

Well integrated, advanced private discussions.

61105.8k9](/packages/fof-byobu)[fof/user-bio

Add a user bio to user profiles

2196.5k9](/packages/fof-user-bio)[fof/links

Manage Flarum primary navbar menu links

39118.3k2](/packages/fof-links)[fof/drafts

Allow users to create post and discussion drafts

1771.1k5](/packages/fof-drafts)[fof/nightmode

Add a Night Mode option for your users to use on your Flarum forum

3774.5k2](/packages/fof-nightmode)[fof/best-answer

Mark a post as the best answer in a discussion

26135.2k15](/packages/fof-best-answer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
