8000 Bedevere as GH Actions by Mariatta · Pull Request #568 · python/bedevere · GitHub
[go: up one dir, main page]

Skip to content

Bedevere as GH Actions #568

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

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
383afcf
Bedevere as GitHub Actions
Mariatta Jun 12, 2023
6f5ecee
Set the python-version
Mariatta Jun 12, 2023
3c8d9a9
Create Dockerfile
Mariatta Jun 12, 2023
6c0af43
use setup actions v3 and Python 3.11
Mariatta Jun 12, 2023
dc5bd1d
Update Dockerfile and copy the bedevere directory
Mariatta Jun 13, 2023
1ad09f8
File formatting. Empty line at the end of the file.
Mariatta Jun 13, 2023
c8afadd
Typo in Dockerfile
Mariatta Jun 13, 2023
3250100
RUN dir -s
Mariatta Jun 13, 2023
d562d69
Copy to GitHub workspace directory
Mariatta Jun 13, 2023
e6d77d6
Create entrypoint.sh
Mariatta Jun 13, 2023
e9c572e
Entrypoint was in wrong dir
Mariatta Jun 13, 2023
7d0c3a7
Typo in entrypoint filename
Mariatta Jun 13, 2023
ae8aaab
Make entrypoint executable
Mariatta Jun 13, 2023
494aba6
Copy bedevere to GitHub workspace
Mariatta Jun 13, 2023
5cf8707
Copy bedevere folder
Mariatta Jun 13, 2023
17e9c42
Copy bedevere folder
Mariatta Jun 13, 2023
cde6ac1
debug 400 error
Mariatta Jun 13, 2023
4e267ef
debug gh token
Mariatta Jun 13, 2023
4b385c8
Set the GH Token env var
Mariatta Jun 13, 2023
d9d8c6c
Revert changes
Mariatta Jun 13, 2023
484ece3
Remove debug prints
Mariatta Jun 14, 2023
db8e6cb
Remove Procfile
Mariatta Jun 14, 2023
3f9ea88
Remove runtime.txt. It was for Heroku.
Mariatta Jun 14, 2023
784a19c
Set exit code if bedevere errors out.
Mariatta Jun 14, 2023
9dac39a
Debugging
Mariatta Jun 14, 2023
424509d
Debugging
Mariatta Jun 14, 2023
6fa714a
Debugging
Mariatta Jun 14, 2023
9d1a990
Use repo_full_name when retrieving Git Hash
Mariatta Jun 14, 2023
f59a006
Fix tests
Mariatta Jun 14, 2023
05b6aa1
Remove prints
Mariatta Jun 14, 2023
4834a6f
Debug post status
Mariatta Jun 14, 2023
8ec31af
Debug post status
Mariatta Jun 14, 2023
67849cf
Debug post status
Mariatta Jun 14, 2023
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
Prev Previous commit
Next Next commit
Set exit code if bedevere errors out.
  • Loading branch information
Mariatta committed Jun 14, 2023
commit 784a19cfa7c0dc883e74bea7927d8c12dbfe2d47
4 changes: 2 additions & 2 deletions bedevere/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ async def main(event_payload):
print('GH requests remaining:', gh.rate_limit.remaining)
except AttributeError:
pass
return True

except Exception as exc:
traceback.print_exc(file=sys.stderr)
return False
sys.exit(1)

if __name__ == "__main__": # pragma: no cover
if os.environ.get("GITHUB_EVENT_PATH"):
Expand Down
11 changes: 6 additions & 5 deletions tests/test___main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ async def test_success(tmp_webhook, tmp_event_name, tmp_job_id, monkeypatch):
# Sending a payload that shouldn't trigger any networking, but no errors
# either.
event_payload = {"action": "created"}
response = await main.main(event_payload)
assert response
await main.main(event_payload)


async def test_failure(tmp_webhook):
from bedevere import __main__ as main
"""Even in the face of an exception, actions will not crash."""
"""Actions will have exit code in case of errors."""

# Missing GitHub environment variables
event_payload = {}
response = await main.main(event_payload)
assert not response
with pytest.raises(SystemExit) as exc:
await main.main(event_payload)
assert exc.value.code == 1
0