-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Configure dependabot version updates (#15)
- Loading branch information
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
ci/dependabot: Configure dependabot version updates | ||
``` |
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
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: "go 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" |
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
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:$GITHUB_TOKEN@github.com/${{ github.repository }}.git" HEAD:${{ github.event.pull_request.head.ref }} |