Fetch tags within drone plugin

I’m trying to convert a simple pipeline into a plugin:

The original pipeline does:

---
kind: pipeline
name: check pr size
steps:
- name: check size
  image: xx.xxx.net/git-file-size-diff
  steps:
    - git fetch --tags
    - git-size.sh

If I add git fetch --tags to git-size.sh and run as:

---
kind: pipeline
name: check pr size
steps:
- name: check size
  image: xxx/git-file-size-diff

fatal: could not read Username for 'https://git.xxxx: terminal prompts disabled

ie drone does not inject the token as it would for a pipeline. Is there a way to have this in a plugin?

Complete code is here: GitHub - johanvdw/drone_size: Compare HEAD size to base branch

@johanvdw,

If you want to globally expose secrets to a plugin you can use organization secrets, https://docs.drone.io/secret/organization/

@johanvdw if you are creating a plugin that requires access to the clone credentials, see the following thread Netrc missing in just-built container. Please note that the netrc variables are considered internal use only and could be removed or further restricted in a future release (however we would not make such a change without a major version bump).

Thanks,

I can confirm this works now!