Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
607eac6
feat: skeleton for TS hooks
Lumycea Mar 30, 2026
e643aae
feat: add EventHandler type
Lumycea Mar 30, 2026
eacee21
style: add prettier check & ignore
Lumycea Mar 30, 2026
9d73053
feat: add flow registration & run
Lumycea Mar 31, 2026
e7a4940
feat: make flow handlers async
Lumycea Mar 31, 2026
d68cf1c
style: reformat
Lumycea Mar 31, 2026
315b262
refactor: create src dir
Lumycea Mar 31, 2026
181347e
fix: add .js extension to alias imports
Lumycea Mar 31, 2026
5569001
build: add Dockerfile
Lumycea Mar 31, 2026
e15502d
refactor: rename hooks to flows
Lumycea Mar 31, 2026
411bedd
feat: add dev env for flows
Lumycea Mar 31, 2026
f68babb
feat: add flow to trigger TS flows
Lumycea Mar 31, 2026
d5edebf
fix: run npm install in flows dev env
Lumycea Apr 1, 2026
2562320
feat: add directus object to handlers
Lumycea Apr 1, 2026
6ce6165
ci: add docker build
Lumycea Apr 1, 2026
88b8c1a
feat: improve handler signature
Lumycea Apr 1, 2026
1297bfe
feat: add mailer
Lumycea Apr 1, 2026
1753516
feat: add update method to event
Lumycea Apr 1, 2026
116e43f
feat: add missing methods to events
Lumycea Apr 2, 2026
0fffe22
feat: add TTL
Lumycea Apr 2, 2026
9c67078
feat: remove unused imports
Lumycea Apr 2, 2026
c3f1c9d
docs: add comment documentation
Lumycea Apr 2, 2026
958dfac
docs: start flows readme
Lumycea Apr 3, 2026
2464651
refactor: rename HandlerOpts to HandlerUtils
Lumycea Apr 3, 2026
026a769
refactor: create subfolder for flows
Lumycea Apr 3, 2026
c2a7ec3
docs: complete readme
Lumycea Apr 3, 2026
5a31f16
feat(flows): update TS trigger with accountability
Lumycea Apr 9, 2026
91dffe7
fix: remove example flows
Lumycea Apr 9, 2026
e381cc6
feat: add type for ICBDActivity.timeslots
Lumycea Apr 9, 2026
c23f94f
feat: add flow to update ICBDActivity fullness
Lumycea Apr 9, 2026
abae32b
feat: add logger
Lumycea Apr 9, 2026
849faea
chore: update deps
Lumycea Apr 9, 2026
4a2e770
feat: remove directus "Update ICBD activity" status flows
Lumycea Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: ["main"]
# Publish semver tags as releases.
tags: ["v*.*.*"]
pull_request:
branches: ["main"]

# abort running jobs if newer version is detected on same branch
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
BASE_IMAGE_NAME: directus-flows

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.3.0
with:
cosign-release: "v2.2.3"

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: flows/Dockerfile

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
directus-config
hooks/dist
97 changes: 77 additions & 20 deletions directus-config/collections/flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,83 @@
"status": "active",
"trigger": "event"
},
{
"_syncId": "60212b34-cb7a-4278-b484-98cff4d84933",
"accountability": "all",
"color": null,
"description": null,
"icon": "bolt",
"name": "Trigger TS Flows",
"operation": "090b7ffc-cd42-47f8-8d7a-5334db4d108a",
"options": {
"collections": [
"association",
"association_poles",
"association_poles_translations",
"association_memberships",
"association_memberships_translations",
"association_public_files",
"association_public_files_translations",
"association_partners",
"association_social_links",
"association_translations",
"commissions",
"commission_memberships",
"commission_memberships_translations",
"commissions_social_links",
"commissions_translations",
"languages",
"members",
"news",
"news_partners",
"news_commissions",
"news_translations",
"partners",
"partner_category",
"partner_category_translations",
"social_links",
"events",
"registrations",
"clothes_orders",
"icbd_activities_registrations",
"inventory",
"galleries",
"save_the_date",
"save_the_date_translations",
"std_cell",
"std_cell_translations",
"subsonic",
"artists",
"subsonic_translations",
"icbd",
"icbd_files",
"icbd_translations",
"icbd_speakers",
"icbd_phds",
"icbd_activities",
"icbd_activities_translations",
"icbd_activities_icbd_speakers",
"game_star",
"game_star_translations",
"game_star_articles",
"game_star_articles_translations",
"game_star_events",
"game_star_events_translations",
"game_star_projects",
"game_star_social_links",
"game_star_projects_translations",
"clothes"
],
"scope": [
"items.create",
"items.update",
"items.delete"
],
"type": "action"
},
"status": "active",
"trigger": "event"
},
{
"_syncId": "6c94bf7c-3939-4eca-8b5f-e199bd9022c3",
"accountability": "all",
Expand Down Expand Up @@ -305,26 +382,6 @@
"status": "active",
"trigger": "event"
},
{
"_syncId": "d2ba770b-1958-4b19-bcd3-82193aac3a3d",
"accountability": "all",
"color": "#FF9D2D",
"description": "Updates activities timeslots to indicate whether they are full",
"icon": "lock_reset",
"name": "[ICBD] Update activity status",
"operation": "e5551dae-8ba2-4711-aa47-1ffe2f9a267e",
"options": {
"collections": [
"icbd_activities_registrations"
],
"scope": [
"items.update"
],
"type": "action"
},
"status": "active",
"trigger": "event"
},
{
"_syncId": "d408862a-d0fe-465a-817c-2ad99fdbe21b",
"accountability": "all",
Expand Down
Loading
Loading