Search code examples
bitbucketgatsbynetlifynetlify-cms

Bitbucket with Netlify CMS editorial Workflow


I have a web app that is built in Gatsby and Netlify CMS with Bitbucket. Been looking for a way to implement editorial workflow in Netlify CMS. But seems that I cant make it work. Here's my code in my config.yml

backend:
  name: bitbucket
  repo: sample/repo
  branch: master
  auth_type: implicit
  commit_messages:
    create: 'Create {{collection}} “{{slug}}”'
    update: 'Update {{collection}} “{{slug}}”'
    delete: 'Delete {{collection}} “{{slug}}”'
    uploadMedia: '[skip ci] Upload “{{path}}”'
    deleteMedia: '[skip ci] Delete “{{path}}”'

local_backend: true
publish_mode: editorial_workflow
media_folder: static/img
public_folder: /img

I've hit a roadblock , I'm new to this kind of setup and researching about this in days. Any help would be deeply appreciated. Thank you so much and God bless!


Solution

  • As you can see in Netlify's docs, the use in Bitbucket is still in beta, only available in version up to 2.10.6 (netlify-cms) or 2.11.3 (netlify-cms-app):

    publish_mode: editorial_workflow

    In order to track unpublished entries statuses the GitLab implementation uses merge requests labels and the BitBucket implementation uses pull requests comments.

    In addition, when dealing with Bitbucket, you need to add the app_id in the config.yml (among the rest of configurations):

    backend:
     name: bitbucket
     repo: owner-name/repo-name
     branch: default
     auth_type: implicit
     app_id: # The Key from your Bitbucket settings
     publish_mode: editorial_workflow
    

    If your versions are up to date and the configuration properly set, you will see at the top of the screen the editorial workflow tab:

    Editorial workflow in Netlify

    The full workflow:

    enter image description here

    Keep in mind that the editorial workflow will only work in certain types of collections.