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

publish.yml: Incorrect type. Expected "array". #10207

Closed
ozanozbeker opened this issue Jul 2, 2024 · 14 comments · May be fixed by quarto-dev/quarto-web#1264
Closed

publish.yml: Incorrect type. Expected "array". #10207

ozanozbeker opened this issue Jul 2, 2024 · 14 comments · May be fixed by quarto-dev/quarto-web#1264
Assignees
Labels
documentation Doc improvements & quarto-web needs-repro Issues that are blocked until reporter provides an adequate reproduction stale Issues open for 30+ days without providing a "working" reproducible example
Milestone

Comments

@ozanozbeker
Copy link

What would you like to do?

Report an issue on quarto.org

Description

Using the documentation to publish on Netlify via GitHub Actions, the .github/workflows/publish.yml gives the Problem: Incorrect type. Expected "array". when using:

on:
  workflow_dispatch:
  push:
    branches: main

I believe it's supposed to be:

on:
  workflow_dispatch:
  push:
    branches: 
      - main
@ozanozbeker ozanozbeker added the documentation Doc improvements & quarto-web label Jul 2, 2024
@mcanouil
Copy link
Collaborator

mcanouil commented Jul 3, 2024

Could you provide?

  • the link to where in the documentation you think there is a mistake
  • the log of your workflow showing the error

What you shared is unfortunately not enough especially because it has no syntax errors, see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-branches-and-tags.
So the error you are talking about is for another part of your GitHub Action YAML.

@mcanouil mcanouil added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Jul 3, 2024
@cderv
Copy link
Collaborator

cderv commented Jul 16, 2024

@ozanozbeker Thanks a lot for the feedback. All our doc uses this syntax, which does not seem to be valid (anymore?)
Doc page example: https://quarto.org/docs/publishing/netlify.html#publish-action

It should be

on:
  workflow_dispatch:
  push:
    branches: 
      - main

or

on:
  workflow_dispatch:
  push:
    branches: [main]

we'll update

@cderv cderv self-assigned this Jul 16, 2024
@cderv cderv removed the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Jul 16, 2024
@cderv cderv added this to the v1.6 milestone Jul 16, 2024
@cderv
Copy link
Collaborator

cderv commented Jul 16, 2024

Just to clarify: The syntax used in the example does trigger linting error in VSCODE when using Actions extension
image

Though it is valid syntax as our own workflow is using it

push:
branches: main

and this CI is running ok.

To not trigger this linting schema error on our example, I'll update the doc using expected syntax.

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 16, 2024

What is giving you the linter error? The GitHub Actions extension is happy.

image

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 16, 2024

To me the issue is somewhere else. Somewhere that wrongly enforces a restricted version of the GitHub Actions schema.
Changing the documentation is not a proper fix as an error/warning should not even exist here.

@cderv
Copy link
Collaborator

cderv commented Jul 16, 2024

What is giving you the linter error? The GitHub Actions extension is happy.

Not github action then 🤷 - I got this in my VSCODE.
image

Github Workflow extension ? 🤔

Somewhere that wrongly enforces a restricted version of the GitHub Actions schema.

Possibly. Don't know where the updated schema lives.

Changing the documentation is not a proper fix as an error/warning should not even exist here.

yes agree. Though using any form is ok, and using [ ] or - is usually the best syntax, as it allows to easily add new branches to the trigger. So even is not a "proper fix", it culd be seen as valid update.

@mcanouil
Copy link
Collaborator

yes agree. Though using any form is ok, and using [ ] or - is usually the best syntax, as it allows to easily add new branches to the trigger. So even is not a "proper fix", it culd be seen as valid update.

I was not saying, don't do this.

But we need to identify more clearly what is blocking here as some users might use the "branches: main" syntax and get no warnings or else from GitHub itself.

@cderv
Copy link
Collaborator

cderv commented Jul 16, 2024

Github Workflow extension ? 🤔

It is about schema validation in VSCODE it seems
image

I can change it by clicking on it
image

which triggers other linting error 😅
image

Correctly using Github Action workflow as the file type (and not YAML) shows no error.
image

Good to know ! Thanks for pointing that out

@cderv
Copy link
Collaborator

cderv commented Jul 16, 2024

@ozanozbeker we round trip to the source of the problem.

the .github/workflows/publish.yml gives the Problem: Incorrect type. Expected "array".

Where did you get this error ?

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 16, 2024

Using the documentation to publish on Netlify via GitHub Actions, the .github/workflows/publish.yml gives the Problem: Incorrect type. Expected "array". when using:

FYI, I added the needs-repro because we don't know from where the "error" comes from.

@cderv cderv added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Jul 16, 2024
@cderv
Copy link
Collaborator

cderv commented Jul 16, 2024

Ok I added it back

Copy link
Contributor

Thank you for using Quarto and reporting an issue!

Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate.
If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository.
Without a reproducible example, it is unlikely that the issue will be addressed.

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)
```

The end.
````

@github-actions github-actions bot added the stale Issues open for 30+ days without providing a "working" reproducible example label Jul 31, 2024
@cderv
Copy link
Collaborator

cderv commented Jul 31, 2024

@ozanozbeker do you have more details to share ?

@cscheid
Copy link
Collaborator

cscheid commented Aug 16, 2024

I'm going to go ahead and close this one. If the original reporter can provide more information, please feel free to reopen.

@cscheid cscheid closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Doc improvements & quarto-web needs-repro Issues that are blocked until reporter provides an adequate reproduction stale Issues open for 30+ days without providing a "working" reproducible example
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants