Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d917f5c
print comment body
boegel Nov 9, 2019
a15a115
use PyGitHub
boegel Nov 9, 2019
954b047
fix typo
boegel Nov 9, 2019
9f39ac5
fix another typo
boegel Nov 9, 2019
6e2f402
thank author for comment
boegel Nov 9, 2019
e514144
print raw event data
boegel Nov 9, 2019
3ad9953
use github-actions Python package
boegel Nov 9, 2019
2937382
add missing import for pprint
boegel Nov 9, 2019
d843545
add missing import for os
boegel Nov 9, 2019
f6c64d9
also trigger on labeling of pull request
boegel Nov 9, 2019
6d6cdc3
only reply to comment for issue_comment events
boegel Nov 9, 2019
a070a4a
fix typo
boegel Nov 9, 2019
eb90788
use actions.get_event_name()
boegel Nov 9, 2019
05d2667
use get_event_data(verbose=True)
boegel Nov 9, 2019
c0e698a
take into account rename to py-github-actions
boegel Nov 9, 2019
e44a9a9
use get_event_trigger()
boegel Nov 9, 2019
9b93086
mention comment body in reply
boegel Nov 9, 2019
c0ec162
tweak reply
boegel Nov 9, 2019
2e9bfb1
use triggered_by
boegel Nov 9, 2019
5c7bf04
fix import for get_event_data
boegel Nov 9, 2019
0b9462d
fix call to get_event_data
boegel Nov 9, 2019
b7cd1dc
use post_comment function
boegel Nov 10, 2019
2f53d32
use template value in comment
boegel Nov 10, 2019
d96ab83
print comments & label names
boegel Nov 10, 2019
438f80a
print PR status
boegel Nov 10, 2019
9f96e1a
also trigger when milestone is set
boegel Nov 10, 2019
8d4261f
print milestone title
boegel Nov 10, 2019
54da858
fix typo
boegel Nov 10, 2019
5f3be31
fix import
boegel Nov 10, 2019
c71e1db
fix printing of milestone (may be None)
boegel Nov 10, 2019
28e92a5
only reply to actual comments
boegel Nov 10, 2019
d9e55d6
add missing import
boegel Nov 10, 2019
86cc77e
add Python script to test with
boegel Nov 10, 2019
9ee52ee
add GitHub Actions CI workflow
boegel Nov 10, 2019
0b72410
also trigger test workflow on status change
boegel Nov 10, 2019
a6f8fa6
fix name for CI workflow
boegel Nov 10, 2019
027d4b3
try to always trigger on status change
boegel Nov 10, 2019
d2e949e
try to always trigger on status change
boegel Nov 10, 2019
e614456
make test run longer
boegel Nov 10, 2019
2d69419
try to always trigger on status change
boegel Nov 10, 2019
87b864a
try to always trigger on status change
boegel Nov 10, 2019
0fc13a0
only trigger on status change
boegel Nov 10, 2019
55cbab1
try to use check_suite trigger
boegel Nov 10, 2019
8a6aac7
update README
boegel Nov 10, 2019
6ce8b09
longer test
boegel Nov 10, 2019
85d1a28
longer test
boegel Nov 10, 2019
d97900a
longer test
boegel Nov 10, 2019
529e6fc
longer test
boegel Nov 10, 2019
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
18 changes: 0 additions & 18 deletions .github/workflows/blank.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test suite
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, 3.6, 3.7, 3.8]
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: set up Python
uses: actions/setup-python@v1
with:
python-version: ${{matrix.python}}
- name: run tests
run: |
pip install pytest
pytest -v test.py
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: test
on:
check_suite:
types: [completed]
issue_comment:
types: [created]
issues:
types: [milestoned]
pull_request:
types: [labeled]
jobs:
react-to-comment:
runs-on: ubuntu-latest
steps:
- name: install dependencies
run: |
pip install PyGithub
pip install git+https://github.com/boegel/py-github-actions.git
- name: react to comment
shell: python
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
from actions.event import get_event_data, triggered_by
from actions.issues import *

# print event data (just for debugging purposes)
event_data = get_event_data(verbose=True)

print('comments:\n' + '\n'.join(get_issue_comments()))
print('labels: ' + ', '.join(get_label_names()))
print('milestone: %s' % get_milestone_title())
if pr_context():
print('PR status: ' + get_pr_status())

if triggered_by('issue_comment'):
reply_txt = "@%(sender_login)s: Thank you for your comment '%(comment_body)s'!"
post_comment(reply_txt)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# test-github-actions
Testing GitHub Actions...

This is just a test
6 changes: 6 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import time

def test():
for i in range(30):
assert(i == i)
time.sleep(1)