diff --git a/docusaurus/docs/set-up/set-up-github.md b/docusaurus/docs/set-up/set-up-github.md index 6d4b153ace..14212ce1a0 100644 --- a/docusaurus/docs/set-up/set-up-github.md +++ b/docusaurus/docs/set-up/set-up-github.md @@ -89,34 +89,11 @@ The workflow contains the following steps: The create plugin update (`cp-update.yml`) workflow automates keeping your plugin's development environment and dependencies up to date. It periodically checks the latest version of create-plugin listed on the npm registry and compares it to the version used by your plugin. If there's a newer version available, the workflow runs the `create-plugin update` command, updates the frontend dependency lockfile, then creates a PR with the changes for review. -This workflow requires content and pull request write access to your plugin's repo to push changes and open PRs. Choose from the following two options: +This workflow requires content, pull request and workflow write access to your plugin's repo to push changes and open PRs. -### Use the default access token +### Add a personal access token -To use this option you must allow [github actions to create and approve pull requests](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests) within your repository settings and use the `permissions` property in the workflow to elevate the default access token permissions like so: - -```yaml -name: Create Plugin Update - -on: - workflow_dispatch: - schedule: - - cron: '0 0 1 * *' # run once a month on the 1st day - -permissions: - contents: write - pull-requests: write - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: grafana/plugin-actions/create-plugin-update@main -``` - -### Use a personal access token - -To use this option, you must create a GitHub [fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with access to the plugin repository and permission to read and write both `contents` and `pull requests`. After you create the token, add it to the plugin repository action secrets and then pass it to the action: +To use this workflow you must create a GitHub [fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with access to the plugin repository and permission to read and write `contents`, `pull requests` and `workflows`. After you create the token, add it to the plugin repository action secrets as `GH_PAT_TOKEN` then pass it to the action: ```yaml name: Create Plugin Update @@ -130,7 +107,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: grafana/plugin-actions/create-plugin-update@main + - uses: grafana/plugin-actions/create-plugin-update@create-plugin-update/v1.1.0 with: token: ${{ secrets.GH_PAT_TOKEN }} ``` diff --git a/docusaurus/website/docusaurus.config.ts b/docusaurus/website/docusaurus.config.ts index 539500b674..05f4a95efe 100644 --- a/docusaurus/website/docusaurus.config.ts +++ b/docusaurus/website/docusaurus.config.ts @@ -30,7 +30,6 @@ const config: Config = { url: PORTAL_URL, baseUrl: 'developers/plugin-tools/', onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', onBrokenAnchors: 'throw', favicon: 'img/favicon.png', // GitHub pages deployment config. @@ -52,6 +51,11 @@ const config: Config = { useCssCascadeLayers: false, }, }, + markdown: { + hooks: { + onBrokenMarkdownLinks: 'warn', + }, + }, plugins: [ [ './plugins/docusaurus-custom-webpack-plugin', diff --git a/packages/create-plugin/templates/github/workflows/cp-update.yml b/packages/create-plugin/templates/github/workflows/cp-update.yml index 74c8ee930a..2580f734bb 100644 --- a/packages/create-plugin/templates/github/workflows/cp-update.yml +++ b/packages/create-plugin/templates/github/workflows/cp-update.yml @@ -1,3 +1,4 @@ +{{!-- /* 🚨 The `${{ }}` Github workflow expressions need to be escaped so they are not being interpreted by Handlebars. (this comment is going to be removed after scaffolding) 🚨 */ --}} name: Create Plugin Update on: @@ -5,22 +6,16 @@ on: schedule: - cron: '0 0 1 * *' # run once a month on the 1st day -# To use the default github token with the following elevated permissions make sure to check: -# **Allow GitHub Actions to create and approve pull requests** in https://github.com/ORG_NAME/REPO_NAME/settings/actions. -# Alternatively create a fine-grained personal access token for your repository with -# `contents: read and write` and `pull requests: read and write` and pass it to the action. - -permissions: - contents: write - pull-requests: write +# To use this workflow please create a fine-grained personal access token for your repository with: +# `contents: read and write` +# `pull requests: read and write` +# `workflows: read and write` jobs: release: runs-on: ubuntu-latest steps: - uses: grafana/plugin-actions/create-plugin-update@create-plugin-update/v1.1.0 - # Uncomment to use a fine-grained personal access token instead of default github token - # (For more info on how to generate the token see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) - # with: - # Make sure to save the token in your repository secrets - # token: ${{ secrets.GH_PAT_TOKEN }} + with: + # Make sure to save the token in your repository secrets as `GH_PAT_TOKEN` + token: $\{{ secrets.GH_PAT_TOKEN }}