Skip to content

Commit

Permalink
CLOUDP-231603: Fix updating dependabot licenses
Browse files Browse the repository at this point in the history
Signed-off-by: jose.vazquez <jose.vazquez@mongodb.com>
  • Loading branch information
josvazg committed Feb 28, 2024
1 parent 7f38fa5 commit cb9e0ee
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/update-licenses.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Update dependabot PR Licenses
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to patch"
required: true
push:
branches:
- dependabot/go_modules/**
Expand All @@ -12,22 +16,29 @@ jobs:
run:
name: Recompute licenses & update PR
runs-on: ubuntu-latest
env:
BRANCH: ${{ inputs.branch || github.ref_name }}
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
- name: Recompute licenses
run: make recompute-licenses

- uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: |
Updated dependency licenses
dependabot skip
branch: ${{ github.head_ref }}
- name: Commit as needed
run: |
if [[ $(git diff --stat) != '' ]]; then
echo 'Committing changes'
git add .
git commit -m "Fix licenses after dependabot changes"
git push
else
echo 'Clean nothing to do'
fi

0 comments on commit cb9e0ee

Please sign in to comment.