Skip to content

Dependabot build and auto-review #143

Dependabot build and auto-review

Dependabot build and auto-review #143

name: Dependabot build and auto-review
on:
workflow_run:
workflows:
- 'Dependabot Build Transfer'
branches-ignore:
- 'dependabot/submodules/**'
types:
- completed
permissions:
pull-requests: write
contents: write
jobs:
dependabot-build:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: true
steps:
- name: Checkout gsfpy repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry
- name: Free disk space on build worker
run: |
df -h
sudo apt-get clean
sudo apt-get autoclean && sudo apt-get autoremove -y
df -h
- name: Run tests
env:

Check failure on line 49 in .github/workflows/dependabot-auto-merge.yml

View workflow run for this annotation

GitHub Actions / Dependabot build and auto-review

Invalid workflow file

The workflow is not valid. .github/workflows/dependabot-auto-merge.yml (Line: 49, Col: 13): Unexpected value ''
run: |
poetry install
make test-all
- name: Auto-reject Failed Dependabot PR
if: ${{ failure() }}
run: gh pr review --request-changes -b "Breaking change in dependent package version detected by Dependabot. Manual resolution required." ${{ github.event.workflow_run.head_branch }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
dependabot-merge:
runs-on: ubuntu-latest
needs: [dependabot-build]
steps:
- name: Checkout gsfpy repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Auto-approve Successful Dependabot PR
run: gh pr review --approve ${{ github.event.workflow_run.head_branch }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Auto-merge Successful Dependabot PR
if: ${{ success() }}
run: gh pr merge --auto --squash ${{ github.event.workflow_run.head_branch }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}