-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: validate workflow schema #159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. I made few suggestions. Once you apply them, please show workflow in action in some test repo
@derberg , In case 2 or more yml files are created during a PR, and the first one fails, currently the action will stop at the first failed file. Is it a good idea to do this or validate both the files and then report the error ? |
@Namyalg best developer experience would be to validate all the files and throw error at the end of validation with list of all affected files, end related errors just |
Okay, working on this |
I have made the changes suggested This is a sample workflow run on erroneous workflow files This is sample on a file adhering to the schema Few points :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking better, left some comments, please have a look
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make sure it check only changes in files in .github/workflows
?
@Namyalg hey, need a hand? |
Hey @derberg, working on the changes |
Co-authored-by: Lukasz Gornicki <[email protected]>
@Namyalg fyi there are still 2 not addressed comments |
Hey @derberg, apologize for the delay. |
@Namyalg no worries 👍🏼 @KhudaDad414 can you please have another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see this in action :) thanks @Namyalg 👏
@Namyalg sure, since we do not need them. |
Done with the deletions 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are almost ready to go, but since the creation of this PR, some changes were introduces in project in regards to "global" files.
- You need to add this new workflow explicitly to https://github.com/asyncapi/.github/blob/master/.github/workflows/global-replicator.yml#L134 list
- You need to move JS script to workflows/scripts and add there to the script a comment on what is this script used for. If for my other comment, you go with
package.json
andpackage-lock.json
then you will need to add there a folder for the script and related files
Lemme know if you need more explanation
Okay @derberg , will look into it |
@Namyalg need help? |
@Namyalg I hope you plan to complete it as you spent a lot of time on it. We have one contributor that is willing to complete it for you, but I want to make sure you are ok with it |
Hello @derberg , working on it. |
Hey @Namyalg, let me know if you need any help. You can ping me on slack as well. :) Always happy to help!! |
any success? maybe we should just start from scratch? we need this validation as we have lots of workflows, and I caused some errors recently just because of syntax error in a workflow 🙃 😄 |
Yes, I think we can start from scratch @derberg |
closing since it has been done here: #238 |
Description
This PR consists of a script and a workflow that validates the yml schema of a workflow file
Related issue(s)
Issue #150
This is sample run on 2 erroneous files