Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependabot updates for Knapsack dependencies #292

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ updates:
- dependency-name: "@knapsack/*"
commit-message:
prefix: "deps"
open-pull-requests-limit: 5
open-pull-requests-limit: 1
labels:
- "dependencies"
- "knapsack-dependencies"
versioning-strategy: increase
group:
name: "knapsack-dependencies"
description: "Group updates for Knapsack dependencies"
reviewers:
- "brittanysmart"
target-branch: "main"
46 changes: 43 additions & 3 deletions .github/workflows/label-dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,55 @@
# This workflow automatically labels Dependabot PRs related to Knapsack dependencies

name: Label Dependabot PRs

on:
pull_request:
types: [opened, synchronize]
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
label:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
timeout-minutes: 5
permissions:
issues: write
steps:
- name: Add 'dependencies' label
- name: Check if PR is from Dependabot
id: check_dependabot
run: |
if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then
echo "is_dependabot=true" >> $GITHUB_ENV
else
echo "is_dependabot=false" >> $GITHUB_ENV
echo "Not a Dependabot PR, skipping label addition."
exit 0 # Exit early if not a Dependabot PR
fi

- name: Check if PR title is related to Knapsack dependencies
id: check_knapsack
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
echo "PR Title: $PR_TITLE"
if [[ "${PR_TITLE,,}" == *"knapsack"* ]]; then
echo "is_knapsack=true" >> $GITHUB_ENV
echo "Adding label 'knapsack-dependencies'"
else
echo "is_knapsack=false" >> $GITHUB_ENV
fi

- name: Add 'knapsack-dependencies' label
if: env.is_dependabot == 'true' && env.is_knapsack == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'dependencies'
labels: knapsack-dependencies
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check for errors
if: failure()
run: |
echo "An error occurred during the workflow execution."
exit 1
Loading