dependabot / dependabot/dependabot-core

Using secret for url field

Open
#7,191 4 comments 6 reactions 0 assignees View on GitHub
T: feature-request
Dominant language
Ruby
Stars
5.8k
Forks
1.5k
Avg merge
2d 18h
Merged PRs (30d)
155

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Feature description

Hello,
I tried to use a dependabot secret (or combinaison of ones) for the url field but it seems impossible. I always get an error message saying that it's not a proper http or https valid url.
I guess this due to a lack of templating ([issue here](https://github.com/dependabot/dependabot-core/issues/5750)) ?

To be more specific, my current `dependabot.yml` file that works for me is:

```yaml
registries:
python-codeartifact:
type: python-index
url: https://XXX/pypi/XXX/simple/
token: ${{secrets.CODEARTIFACT_USERNAME}}:${{secrets.CODEARTIFACT_AUTH_TOKEN}}
replaces-base: false
```
But I would like to do something like this:

```yaml
registries:
python-codeartifact:
type: python-index
url: ${{secrets.CODEARTIFACT_URL}}
# or this
# url: https://${{ secrets.CODEARTIFACT_DOMAIN }}-${{ secrets.CODEARTIFACT_DOMAIN_OWNER }}.d.codeartifact.${{ secrets.AWS_REGION }}.amazonaws.com/pypi/${{ secrets.CODEARTIFACT_REPOSITORY }}/simple/
token: ${{secrets.CODEARTIFACT_USERNAME}}:${{secrets.CODEARTIFACT_AUTH_TOKEN}}
replaces-base: false
```
Is possible to use secret for the url field ?
Thank you

Contributor guide

Open the contributing guide

Research direction

Start with the dependabot.yml registry configuration shown in the issue and the URL validation error, then read the related issue #5750 about templating. Compare the current url and token handling, and verify the desired secret-based URL forms with configuration validation. Done means valid secret substitutions are accepted for the registry url while malformed values still fail clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, github, yaml
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.