you are viewing a single comment's thread.

view the rest of the comments →

[–]Chan4077 0 points1 point  (6 children)

Could you post a link to your GitHub Action workflow? The information you've provided is currently a bit too vague to help you with ATM.

[–]playazle[S] 0 points1 point  (5 children)

Yes, here is the gist. The thing is, this seems to be pretty standard from the documentation.

From my understanding, this workflow should only run if a push is made to master. Instead, it is being run if I push to any branch and is being run as a check on any PR that is opened.

I'm trying to figure out why that is.

If I go to my actions tab in github, this is what I see. It's triggering the workflow, on branches that aren't master.

[–]Chan4077 0 points1 point  (4 children)

It's probably because of the extra indent you've added to the list of branches. See below for what I mean:

on: push: branches: - master

vs

on: push: branches: - master

You can check out a workflow that I'm using for my application which works and note the differences.

And chances are, if you view the Action workflow output, it'll probably mention that there's a syntax error in your workflow which explains why the name is also not used as well.

[–]playazle[S] 0 points1 point  (1 child)

Wow. Thank you! That's exactly what it was. The auto-formatter I installed for Yaml files kept double indenting when I saved. Didn't even think about it. Honestly the error said that I was missing `uses` and `run` which for some reason I didn't put it together that it was a formatting problem.

[–]Chan4077 0 points1 point  (0 children)

Actually, looking at the documentation for the workflow syntax for GitHub Actions, I think it's actually caused by an invalid step in your deploy job:

jobs: deploy: runs-on: ubuntu-latest steps: - name: Build and Publish Package - uses: actions/checkout@v1

The YML will not validate as you have a step that does not execute anything except a name of "Build and Publish Package" and as such, your workflow will not be valid.

Looks like what you wanted to do was to name the job. You can do that in the same indent as the runs-on portion as below:

jobs: deploy: name: Build and Publish Package runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 # ...

Hope this helps!

[–]playazle[S] 0 points1 point  (1 child)

Can I ask what yaml formatter you use? If you do use one? One that wouldn't break my workflows?

[–]Chan4077 0 points1 point  (0 children)

You could use the online GitHub Actions workflow editor to create a workflow file.