From d7d32435ed890373055ca03399b5a1fc8e988e2d Mon Sep 17 00:00:00 2001 From: Mikita Sakalouski <38785549+mikita-sakalouski@users.noreply.github.com> Date: Thu, 30 May 2024 19:46:23 +0200 Subject: [PATCH] Create dependabot.yml (#31) --- .github/dependabot.yml | 11 +++++ .github/workflows/auto-merge-dependabot.yml | 51 +++++++++++++++++++++ .github/workflows/{test.yaml => test.yml} | 2 + README.md | 2 +- 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/auto-merge-dependabot.yml rename .github/workflows/{test.yaml => test.yml} (95%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4011677 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml new file mode 100644 index 0000000..170f35f --- /dev/null +++ b/.github/workflows/auto-merge-dependabot.yml @@ -0,0 +1,51 @@ +name: Auto Merge Dependabot PRs + +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + + steps: + - name: Wait all checks + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.ref }} + check-name: final_check + wait-interval: 10 + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Add a label for all production dependencies + if: steps.metadata.outputs.dependency-type == 'direct:production' + run: gh pr edit "$PR_URL" --add-label "production" + env: + PR_URL: ${{github.event.pull_request.html_url}} + + - name: Enable auto-merge for Dependabot PRs + # steps.dependabot-metadata.outputs.update-type: + # The highest semver change being made by this PR, + # e.g. version-update:semver-major. + # For all possible values, see the ignore documentation. + # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#ignore + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yml similarity index 95% rename from .github/workflows/test.yaml rename to .github/workflows/test.yml index 8107c8e..c19a130 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yml @@ -1,4 +1,6 @@ name: Test +run-name: ${{ 'Tests for PR ' }}${{ github.event.pull_request.number }}${{ ' by ' }}${{ github.event.pull_request.user.login }} + on: pull_request: diff --git a/README.md b/README.md index 7ee2dbd..23454f8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ | | | |---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| CI/CD | [![CI - Test](https://github.com/Nike-Inc/koheesio/actions/workflows/test.yaml/badge.svg)](https://github.com/Nike-Inc/koheesio/actions/workflows/test.yaml) [![CD - Release Koheesio](https://github.com/Nike-Inc/koheesio/actions/workflows/release.yml/badge.svg)](https://github.com/Nike-Inc/koheesio/actions/workflows/release.yml) | +| CI/CD | [![CI - Test](https://github.com/Nike-Inc/koheesio/actions/workflows/test.yml/badge.svg)](https://github.com/Nike-Inc/koheesio/actions/workflows/test.yml) [![CD - Release Koheesio](https://github.com/Nike-Inc/koheesio/actions/workflows/release.yml/badge.svg)](https://github.com/Nike-Inc/koheesio/actions/workflows/release.yml) | | Package | [![PyPI - Version](https://img.shields.io/pypi/v/koheesio.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/koheesio/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/koheesio.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/koheesio/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/koheesio?color=blue&label=Installs&logo=pypi&logoColor=gold)](https://pypi.org/project/koheesio/) | | Meta | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![types - Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](https://github.com/python/mypy) [![docstring - numpydoc](https://img.shields.io/badge/docstring-numpydoc-blue)](https://numpydoc.readthedocs.io/en/latest/format.html) [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License - Apache 2.0](https://img.shields.io/github/license/Nike-Inc/koheesio)](LICENSE.txt) |