Skip to content

mypy_primer: post failures as comments #4672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/mypy_primer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,32 @@ jobs:
python -m pip install -U pip
pip install git+https://github.com/hauntsaninja/mypy_primer.git
- name: Run mypy_primer
shell: bash
run: |
cd typeshed_to_test
echo "new commit"
git rev-list --format=%s --max-count=1 $GITHUB_SHA
git checkout -b upstream_master origin/master
echo "base commit"
git rev-list --format=%s --max-count=1 upstream_master
echo ''
cd ..
echo "ATTENTION: failures here shouldn't be treated as blocking; use your judgement"
echo "(Unfortunately, Github doesn't seem to have an \"allowed_failures\" equivalent)"
mypy_primer --new v0.790 --old v0.790 --custom-typeshed-repo typeshed_to_test --new-typeshed $GITHUB_SHA --old-typeshed upstream_master -o concise
( mypy_primer --new v0.790 --old v0.790 --custom-typeshed-repo typeshed_to_test --new-typeshed $GITHUB_SHA --old-typeshed upstream_master -o concise > diff.txt && rm diff.txt ) || true
cat diff.txt || true
- name: Post comment
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs').promises;
try {
data = await fs.readFile('diff.txt', 'utf-8')
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Diff from mypy_primer:\n```\n' + data + '\n```'
})
} catch (error) {
console.log(error)
}