quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.74k stars 305 forks source link

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

Closed ozanozbeker closed 2 weeks ago

ozanozbeker commented 2 months ago

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
mcanouil commented 2 months ago

Could you provide?

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.

cderv commented 1 month ago

@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 commented 1 month ago

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

https://github.com/quarto-dev/quarto-cli/blob/1c1609c4de06f4d530e448731cca165ee0121e98/.github/workflows/test-quarto-latexmk.yml#L4-L5

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 commented 1 month ago

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

image
mcanouil commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

Ok I added it back

github-actions[bot] commented 1 month ago

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.

cderv commented 1 month ago

@ozanozbeker do you have more details to share ?

cscheid commented 2 weeks ago

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