I wrote a pipeline for running dependabot in a .NET project in Azure DevOps on weekly schedule. This pipeline runs and creates PR for outdated packages version successfully, the pipeline get fails at some point. This is the error in log -
Running with options: {}
Fetching nuget dependency files for FaigleSolutions/Applications/_git/FsAbacusMfilesIntegration
Parsing dependencies information
- Updating Microsoft.AspNetCore.Mvc.NewtonsoftJson (from 5.0.5)… submitted
- Updating Microsoft.Extensions.Hosting.WindowsServices (from 5.0.1)… submitted
- Updating Newtonsoft.Json (from 13.0.1)… submitted
- Updating Swashbuckle.AspNetCore (from 5.6.3)… submitted
- Updating Swashbuckle.AspNetCore.Annotations (from 6.1.3)… submitted
##[error]Bash exited with code '1'.
Finishing: Run Dependabot
Here is my pipeline for dependabot-
trigger: none # Disable CI trigger
schedules:
- cron: '0 2 * * 1' # daily at 2am UTC
always: true # run even when there are no code changes
branches:
include:
- development
batch: true
displayName: Weekly
pool:
vmImage: 'ubuntu-latest'
variables:
- name: PACKAGE_MANAGER
value: nuget
- name: PROJECT_PATH
value: FaigleSolutions/Applications/_git/FsAbacusMfilesIntegration # path to the repo
- name: DIRECTORY_PATH
value: /src/Fs.AbacusMfilesInt # sub-path to the .sln file
- name: AZURE_HOSTNAME
value: dev.azure.com
steps:
- script: git clone https://github.com/dependabot/dependabot-script.git
displayName: Clone Dependabot config repo
- script: |
cd dependabot-script
docker build -t "dependabot/dependabot-script" -f Dockerfile .
displayName: Build Dependabot Image
- script: |
docker run --rm -e AZURE_ACCESS_TOKEN='$(PAT)' -e PROJECT_PATH='$(PROJECT_PATH)' -e DIRECTORY_PATH='$(DIRECTORY_PATH)' -e PACKAGE_MANAGER='$(PACKAGE_MANAGER)' dependabot/dependabot-script
displayName: Run Dependabot
The error occurs in Run Dependabot step.
The error message is vague and I couldn't get it. Can anyone please help me to find the issue? Thanks in advance.
The issue was related to API Rate Limit for some packages. So I added a delay with caching mechanism to retry the failed script and it worked.