Skip to content

Darker PR Bot

Darker PR Bot #1228

Workflow file for this run

name: Darker PR Bot
on:
workflow_run:
workflows: [linters]
types:
- completed
concurrency:
# Probably overly cautious group naming.
# Commits to develop will cancel each other, but PRs will only cancel
# commits within the same PR
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
jobs:
darker_bot:
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: setup_dependencies
run: |
pip install PyGithub
- name: 'Download artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "darkerlint"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/darker_results.zip`, Buffer.from(download.data));
- name: 'Unzip artifact'
run: unzip darker_results.zip
- name: writer-errors
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
python maintainer/ci/darker-outcomes.py --json status.json