Skip to content

Workflow file for this run

name: Update dependabot PR Licenses
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to patch"
required: true
push:
branches:
- dependabot/go_modules/**
pull_request:
branches:
- dependabot/go_modules/**
permissions:
contents: write
pull-requests: write
jobs:
run:
name: Recompute licenses & update PR
runs-on: ubuntu-latest
env:
BRANCH: ${{ inputs.branch || github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "${{ github.workspace }}/go.mod"
cache: false
- name: Recompute licenses
run: make recompute-licenses
- name: Commit as needed
run: |
if [[ $(git diff --stat) != '' ]]; then
echo 'Committing changes'
git config user.email "akobot@ako-team-fake.mongodb.com"
git config user.name "AKOBot"
git add .
git commit -m "Fix licenses after dependabot changes" -m "[dependabot skip]"
git push
else
echo 'Clean nothing to do'
fi