Skip to content

mesh-2092: add make update to workflow #105

mesh-2092: add make update to workflow

mesh-2092: add make update to workflow #105

name: Auto-merge Dependabot PRs
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
jobs:
export-requirements:
# if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: setup python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: setup poetry
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8
with:
poetry-version: 2.1.2
- name: add poetry plugins
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
poetry self add poetry-plugin-export
- name: Export requirements
run: make export-requirements
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add requirements.txt
git diff --staged --quiet || git commit -m "mesh-2092: update requirements.txt"
git push
enable-automerge:
# Only run on Dependabot PRs
needs: export-requirements
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-approve Dependabot PR
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}