Skip to content

Commit

Permalink
ci: Configure dependabot version updates (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
danroux committed Apr 12, 2024
1 parent 15d49b9 commit 0b668c7
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
ci/dependabot: Configure dependabot version updates
```
47 changes: 47 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "America/Vancouver"
labels:
- "dependencies"
- "dependencies/npm"
commit-message:
prefix: "npm deps:"
include: "scope"
open-pull-requests-limit: 10
assignees:
- "danroux"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "America/Vancouver"
labels:
- "dependencies"
- "dependencies/gha"
commit-message:
prefix: "gha deps:"
include: "scope"
open-pull-requests-limit: 10
assignees:
- "danroux"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "America/Vancouver"
labels:
- "dependencies"
- "dependencies/docker"
commit-message:
prefix: "docker deps:"
include: "scope"
open-pull-requests-limit: 10
assignees:
- "danroux"
46 changes: 46 additions & 0 deletions .github/workflows/.dependabot_misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Dependabot Release Notes

on:
pull_request:
types: [opened, synchronize, reopened]

# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#defining-access-for-the-github_token-scopes
permissions:
pull-requests: write
contents: write

jobs:
generate-release-note:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0
- name: Generate .changelog entry
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body_text }}
run: |
FIRST_COMMIT=$(git log -10 --pretty=format:%H origin/main..HEAD | tail -1)
FIRST_COMMIT_BODY=$(git log -1 --pretty=format:%B $FIRST_COMMIT)
mkdir -p .changelog
echo "backticksrelease-note:enhancement" > .changelog/$PR_NUMBER.txt
echo "ci/dependabot: $PR_TITLE" >> .changelog/$PR_NUMBER.txt
echo "" >> .changelog/$PR_NUMBER.txt
echo "$FIRST_COMMIT_BODY" >> .changelog/$PR_NUMBER.txt
echo "backticks" >> .changelog/$PR_NUMBER.txt
sed -i 's/backticks/```/g' .changelog/$PR_NUMBER.txt
- name: Commit and Push
env:
GIT_USER: ${{ secrets.GIT_USER }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
git config --local user.email "dependabot[bot]@users.noreply.github.com"
git config --local user.name "dependabot[bot]"
git add .changelog
git commit -m "Add .changelog entry #${{ github.event.pull_request.number }}"
git push "https://x-access-token:[email protected]/${{ github.repository }}.git" HEAD:${{ github.event.pull_request.head.ref }}

0 comments on commit 0b668c7

Please sign in to comment.