[Question] How do I use the existing yml CI along with dependabot yml ? #1421
Replies: 8 comments 2 replies
-
@Hoang-Minh I would recommend creating a new pipeline specifically for dependabot; You can have dependabot automatically run each day/week using a scheduled trigger. Here are some pipeline examples: Run dependabot weekly on the current repository onlytrigger: none
schedules:
- cron: '0 0 * * 0' # 12:00 UTC on Sunday
always: true
branches:
include:
- main
batch: true
displayName: Weekly (midnight sunday)
pool:
name: Azure Pipelines
vmImage: ubuntu-latest
steps:
- task: dependabot@2
displayName: Run Dependabot
inputs:
# your config here... Run dependabot weekly for multiple repositoriestrigger: none
schedules:
- cron: '0 0 * * 0' # 12:00 UTC on Sunday
always: true
branches:
include:
- main
batch: true
displayName: Weekly (midnight sunday)
parameters:
- name: repositoryNames
displayName: 'Repository Names'
type: object
default:
- 'Repo1'
- 'Repo2'
- 'Repo3'
jobs:
- ${{ each repositoryName in parameters.repositoryNames }}:
- job: dependabot_${{lower(replace(repositoryName, ' ', ''))}}
displayName: Dependabot - ${{repositoryName}}
pool:
name: Azure Pipelines
vmImage: ubuntu-latest
steps:
- task: dependabot@2
displayName: Run Dependabot on ${{repositoryName}}
continueOnError: true
inputs:
targetRepositoryName: ${{repositoryName}}
# your config here...
|
Beta Was this translation helpful? Give feedback.
-
Thanks @rhyskoedijk . What's about the dependabot.yml ? Do I need to include that yml file in the repo ? Does it mean that I need 2 yml files in my repo right ?
|
Beta Was this translation helpful? Give feedback.
-
Yes. If you only have one repo, it's simplest to put both the pipeline and dependabot yml files together in the same repository. e.g.
You do not need to specify |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @rhyskoedijk !!! |
Beta Was this translation helpful? Give feedback.
-
Thanks @rhyskoedijk this is useful info. I was trying this approach where my Dependabot file is set up as follows: dependabot.yml present in repo1 on the dev branch My question is: can we configure the dependabot@2 task to specify a particular branch when using
or anywhere in the run-dependabot pipeline under parameters or in dependabot.yml file? |
Beta Was this translation helpful? Give feedback.
-
@vishnuprakash9845 you can use the |
Beta Was this translation helpful? Give feedback.
-
Thanks @rhyskoedijk for the response. Finally I wanted target as dev branch, where it needs the PR to be created when new version of dependencies available. But the thing which I had doubt is I've added the dependabot.yml file to two repositories and run-dependabot.yml in another one:
When I run the run-dependabot.yml, I encounter the following error: Configuration file not found at possible locations: /.azuredevops/dependabot.yml, /.azuredevops/dependabot.yaml, /.github/dependabot.yaml, /.github/dependabot.yml I beleive it taking dev branch while running. Mycode is in feature branches (adding_dependabot) not in dev currently. Once after the testing it will be moved to dev. My question is: when we run the run-dependabot.yml, does it default to running on the dev branches of Ops.Addition and Ops.Subtraction, or is there a way to configure it to run on feature branches of these repositories? |
Beta Was this translation helpful? Give feedback.
-
Hello, I am also trying to run dependabot scan for multi-repo. I have created one azure pipeline in separate repo there I have configured dependabot@2 task for all repos. But the target repos are in another project within same organization in azure devops.
I believe this is due to it is not pointing to correct repo the PR to be created. In this case, error says it does not find the commit Id whereas commit id exist in target repo but the pipeline is trying to create the PR in the its own repo means the pipeline I believe.
Here is my dependabot.yml file exists in each respective repo that to be scaned and PR to be created there.
Please could you advise, Although I have tried different solutions but no success. Thank you! |
Beta Was this translation helpful? Give feedback.
-
This is not really a bug. It's more like a question that I have.
I currently have an existing yml in a specific folder for CI build. Every time a PR (change) is checked in, we will trigger the CI build.
Now, how do I add or combine the yml for dependabot, considering that in the dependabot we have trigger set to none versus in the CI, we have trigger set to a specific branch ? Ideally, we only want to run the dependabot scan only one time a week. Is it achievable with the v2 dependabot ? Thank you.
azure-pipelines.yml
dependabot-pipelines.yml
dependabot.yml
Beta Was this translation helpful? Give feedback.
All reactions