From 1634b912545595d9cd70826d95c0a77216b075f4 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:56:43 -0400 Subject: [PATCH] ci: Add MANIFEST.in and automerge workflow --- .github/dependabot.yml | 6 ++++++ .github/workflows/automerge.yml | 35 +++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 3 ++- MANIFEST.in | 1 + 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/automerge.yml create mode 100644 MANIFEST.in diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1230149 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..5536573 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,35 @@ +# The pull_request_target workflow trigger is dangerous. Do not add unrelated logic to this workflow. +# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target +name: Auto-merge +on: pull_request_target +permissions: + pull-requests: write # to approve the PR + contents: write # to merge the PR +jobs: + dependabot: + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} + runs-on: ubuntu-latest + steps: + - id: dependabot-metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' || steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr review --approve ${{ github.event.pull_request.html_url }} + - if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' || steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} + precommit: + if: ${{ github.event.pull_request.user.login == 'pre-commit-ci[bot]' }} + runs-on: ubuntu-latest + steps: + - env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr review --approve ${{ github.event.pull_request.html_url }} + - env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ba6ba0a..7df8a21 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,6 +9,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.10' - - run: pip install --upgrade flake8 isort + - run: pip install --upgrade check-manifest flake8 isort - run: flake8 . - run: isort . + - run: check-manifest diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6c9e6b4 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include *.py