diff --git a/.changelog/15.txt b/.changelog/15.txt new file mode 100644 index 00000000..75e0f740 --- /dev/null +++ b/.changelog/15.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +ci/dependabot: Configure dependabot version updates +``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..078b27a9 --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/.dependabot_misc.yml b/.github/workflows/.dependabot_misc.yml new file mode 100644 index 00000000..47a9566d --- /dev/null +++ b/.github/workflows/.dependabot_misc.yml @@ -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 }}