Bump github.com/samber/lo from 1.44.0 to 1.45.0 #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dependabot-check | |
on: | |
pull_request_target: | |
branches: [main] | |
paths: | |
- "go.sum" | |
- "go.mod" | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
dependabot-auto-merge: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'dependabot[bot]' }} | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@v2.1.0 | |
with: | |
github-token: '${{ secrets.GITHUB_TOKEN }}' | |
- uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const ret = await github.rest.issues.listLabelsOnIssue({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.payload.pull_request.number | |
}); | |
const currentLabels = ret.data.map(label => label.name); | |
const addLabels = ['change-category/dependency']; | |
if ('${{ steps.metadata.outputs.update-type }}' == 'version-update:semver-major') { | |
addLabels.push('change-category/breaking'); | |
} | |
const labels = currentLabels.concat(addLabels); | |
await github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.payload.pull_request.number, | |
labels | |
}); | |
- name: Enable auto-merge for Dependabot PRs | |
run: gh pr merge --auto --squash "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Approve if PR is patch update | |
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }} | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Approve if PR is minor update | |
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }} | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |