Skip to content
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

Github actions fail on scheduled workflows #280

Open
kelostrada opened this issue Apr 6, 2022 · 0 comments
Open

Github actions fail on scheduled workflows #280

kelostrada opened this issue Apr 6, 2022 · 0 comments

Comments

@kelostrada
Copy link

When you try to run mix coveralls.github in workflows that are scheduled using cron schedule (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) you get a following error:

** (BadMapError) expected a map, got: nil
    (elixir 1.13.3) lib/map.ex:481: Map.get(nil, "login", nil)
Warning:     (excoveralls 0.14.4) lib/excoveralls/github.ex:93: ExCoveralls.Github.git_info/0
    (excoveralls 0.14.4) lib/excoveralls/github.ex:25: ExCoveralls.Github.generate_json/2
Warning:     (excoveralls 0.14.4) lib/excoveralls/github.ex:8: ExCoveralls.Github.execute/2
    (mix 1.13.3) lib/mix/tasks/test.ex:538: Mix.Tasks.Test.do_run/3
Warning:     (mix 1.13.3) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.3) lib/mix/task.ex:451: Mix.Task.run_alias/5
Warning:     (mix 1.13.3) lib/mix/task.ex:455: Mix.Task.run_alias/5
    (excoveralls 0.14.4) lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2
Warning:     (mix 1.13.3) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.3) lib/mix/cli.ex:84: Mix.CLI.run_task/2
Warning:     (elixir 1.13.3) lib/code.ex:1183: Code.require_file/2

The reason for this is we are trying to read GITHUB_EVENT_PATH file which contains event payload, but the payload doesn't contain anything much in workflows scheduled like this. The file contains basically something like this only:

{
  "schedule": "*/10 * * * *"
}

To fix this we should fallback to other ways of getting information for functions:

  • get_pr_id
  • get_committer_name
  • get_sha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant