danger / danger/danger-js

[BUG] No jobs defined in 'jobs'

Open
#1,040 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
5.5k
Forks
379
Avg merge
2h 8m
Merged PRs (30d)
6

Description

**Describe the bug**
Github says:
> No jobs defined in `jobs`

On the details of a workflow/action that ran.

**To Reproduce**
Steps to reproduce the behavior are the literal steps on [Gettings Started](https://danger.systems/js/guides/getting_started.html). I had to fill in some gaps where it doesn't tell me what to do:
1. Created a new branch where I added `danger` with NPM, and added a `dangerfile.js`.
2. Create an account. This was not clear to me. It doesn't literally say to do that, only that one could optionally do that. Recommended apparently. So I did. I will not be sure why I did this at the end.
3. Created an access token with `repo` permission on the new account. Unclear why this is, or what it's for.
4. Went on to Github Actions to create a new workflow. Again, this was not clear. It just said to do this "after your tests", but we have no tests as a Github Action. They are part of the build process that executes on Azure. So I created a new "workflow" and called it `danger.yml`.
5. Because our project is not strictly a javascript project, I decided on the second YML file, because that's what it recommends. So I pasted that in.
6. Then I had to notice that Github can only either commit to master (which isn't allowed) or create a new branch for this yml file. Ugh. Tell me sooner, will you? So, I reperated this step after deleting the brach I created in step 1, and then re-did the changes from step 1. So I end up with a branch containing two commits. One containing the dangerfile.js & package(-lock) changes, and another commit for this yml file. The order of a good Getting Started is really important, for this exact reason.
7. Then it says something about having to enable GITHUB_TOKEN in the workspace. What workspace? VScode? Visual Studio? Or do you mean the github repo? I have no idea what it's going on about. But it also says Github creates a GITHUB_TOKEN automatically, so I kind of shrugged and hoped that that's indeed the case. I don't know where to find it though, but hey, it promised that it'll be created so all is jolly good, right? I sure hoped so.
8. And that should be it. Or at least the Getting Started is now practically over. I should verify my installation. Alright, I will. So I shall go to the Actions tab on Github and see two actions, apparantly. One for each commit. So it "kind of" works.
9. However on closer inspection, it actually doesn't. The X's in front of the two actions don't tell a positive story. And on of the two, the latter one where I added the package(-lock) and dangerfile.js changes, fails. And failing it does, with the error message at the start of this issue.

**Expected behavior**
I honestly don't know what to expect. I've never worked with DangerJS, or with Github Actions, or with secret tokens. However, I would most definitely not expect an error such as the above. I would expect it to at least run its job. Execute the dangerfile.js, I suppose. And because I haven't created a PR yet (the Getting started hasn't instructed me to do so, as far as I could tell), I would expect it to succeed with flying colours, because there is no PR for DangerJS to complain on just yet.

I would try creating a PR that has an issue to see if DangerJS complains on it, but I would first like things to work. Or at least not spew out errors.

**Screenshots**
![Capture](https://user-images.githubusercontent.com/152227/81515682-8b6dcc80-9335-11ea-8c94-192b111a685a.PNG)

** Your Environment**

| software | version
| ---------------- | -------
| danger.js | 10.2.0
| node | 12.16.3
| npm | 6.14.4
| Operating System | Windows 10

**Additional context**
A better Getting Started might help a LOT.
Also I still don't quite get why I had to create that new account. I did do it, but I haven't been instructed to use it in any way yet, other than to generate that access token. Should I put that access token somewhere? If only the Getting Started would tell me the what to do more precisely. All along this document I had the feeling that it assumed I knew some magical invisible intermediate steps that have to be taken in order for the next steps to work properly.

Or maybe it's just late and someone will point out some crucial thing I overlooked.
Either way, thanks for this tool that looks to be awesome. I'm sure it will be.

Contributor guide

Open the contributing guide

Research direction

Start with the linked Getting Started guide and the example danger.yml workflow, then compare them with the reported setup sequence. Clarify the account, access-token, GITHUB_TOKEN, workflow-ordering, and pull-request steps so a new user can create a workflow with a defined job and verify that dangerfile.js runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.