colibris-xyz / strapi-plugin-site-publisher

This is a plugin for Strapi headless CMS. It lets you trigger a GitHub Action workflow when the site is ready to be published.
MIT License
6 stars 3 forks source link

Config issue in readme #62

Closed sapersky closed 1 year ago

sapersky commented 1 year ago

All the config should be within "config" field, otherwise you'll get an error:

Error regarding site-publisher config: owner is required

Instead of :

module.exports = ({ env }) => ({
  'site-publisher': {
    owner: 'username', // The Github organisation or user
    repo: 'reponame', // The name of the repository
    workflow_id: 'rebuild.yml', // The workflow_id or filename
    token: env('GITHUB_TOKEN'), // The GitHub personal access token with access to trigger workflows and view build status
    branch: 'master', // The branch the workflow should be triggered on
    inputs: {
      // Optional inputs to pass through to the GitHub workflow
      some_input: 'Some value',
      some_other_input: 'Some other value',
    },
  },
});

Should be:

module.exports = ({ env }) => ({
    'site-publisher': {
        config: {
            owner: 'username', // The Github organisation or user
            repo: 'reponame', // The name of the repository
            workflow_id: 'rebuild.yml', // The workflow_id or filename
            token: env('GITHUB_TOKEN'), // The GitHub personal access token with access to trigger workflows and view build status
            branch: 'master', // The branch the workflow should be triggered on
            inputs: {
                // Optional inputs to pass through to the GitHub workflow
                some_input: 'Some value',
                some_other_input: 'Some other value',
            },
        }
    },
});
tms0 commented 1 year ago

Thanks for the reporting, this is fixed!