diff --git a/.github/workflows/dependabot-auto-merge.yaml b/.github/workflows/dependabot-auto-merge.yaml index 95f57ed..bb440ad 100644 --- a/.github/workflows/dependabot-auto-merge.yaml +++ b/.github/workflows/dependabot-auto-merge.yaml @@ -10,8 +10,48 @@ on: - 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: