pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gh_env no longer accepts a function

mrjones2014 opened this issue · comments

commented

Issue Description

Type: bug report

Describe what happened (or what feature you want)

The gh_env option no longer accepts a function; it should accept a table or a function returning a table

Describe what you expected to happen

I can use a function like

{
  'pwntester/octo.nvim',
  cmd = 'Octo',
  opts = {
    gh_env = function()
      local github_token = require('op').get_secret('GitHub', 'token')
      if not github_token or not vim.startswith(github_token, 'ghp_') then
        error('Failed to get GitHub token.')
      end
                                                                           
      return { GITHUB_TOKEN = github_token }
    end,
  },
}

How to reproduce it (as minimally and precisely as possible)

  1. Use the above config for gh_env
  2. Try to use octo.nvim
  3. Get an error that config is invalid

Tell us your environment

Anything else we need to know?