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

workflow: Add actionlint workflows #2146

Merged
merged 10 commits into from
Nov 13, 2024

Conversation

stevenhorsman
Copy link
Member

@stevenhorsman stevenhorsman commented Nov 8, 2024

On PRs that update anything in the workflows directory, add an actionlint run to validate our workflow files for errors and hopefully catch issues earlier.

Also fix the many issues we already have!

@stevenhorsman stevenhorsman force-pushed the actionlint branch 4 times, most recently from f66c3c2 to 357009b Compare November 8, 2024 15:15
@stevenhorsman stevenhorsman marked this pull request as ready for review November 8, 2024 15:17
@stevenhorsman stevenhorsman requested a review from a team as a code owner November 8, 2024 15:17
@stevenhorsman
Copy link
Member Author

The run against my fork can be seen: https://github.com/stevenhorsman/cloud-api-adaptor/actions/runs/11744726638/job/32720502155, but I was hoping that the workflow would be run on this PR as well, so I'm not sure if I've made a mistake with it?

@wainersm
Copy link
Member

Hi @stevenhorsman !

The run against my fork can be seen: https://github.com/stevenhorsman/cloud-api-adaptor/actions/runs/11744726638/job/32720502155, but I was hoping that the workflow would be run on this PR as well, so I'm not sure if I've made a mistake with it?

There is a typo on the paths filter: s/worksflows/workflows/
So it's expecting changes on wrong path. In your fork you probably triggered manually (workflow_dispatch).

On PRs that update anything in the workflows directory,
add an actionlint run to validate our workflow files for errors
and hopefully catch issues earlier.

Signed-off-by: stevenhorsman <[email protected]>
Added configuration file with rules to exclude some self-hosted
runners from the linter warnings.

Signed-off-by: stevenhorsman <[email protected]>
> Useless cat. Consider cmd < file | ..

Update to fix shellcheck issue

Signed-off-by: stevenhorsman <[email protected]>
> Quote this to prevent word splitting.

Quote around path

Signed-off-by: stevenhorsman <[email protected]>
> input "image_tags" of workflow_call event has the default value "", but it is also required. if an input is marked as required, its default value will never be used

Signed-off-by: stevenhorsman <[email protected]>
 > Double quote to prevent globbing and word splitting.

Signed-off-by: stevenhorsman <[email protected]>
> Use find instead of ls to better handle non-alphanumeric filenames.

Signed-off-by: stevenhorsman <[email protected]>
> This loop will only ever run once. Bad quoting or missing glob/expansion?

Update logic to remove the loop and simplify

Signed-off-by: stevenhorsman <[email protected]>
> Double quote array expansions to avoid re-splitting elements

Signed-off-by: stevenhorsman <[email protected]>
> Use $(...) notation instead of legacy backticks `...`

Signed-off-by: stevenhorsman <[email protected]>
@stevenhorsman
Copy link
Member Author

Hi @stevenhorsman !

The run against my fork can be seen: https://github.com/stevenhorsman/cloud-api-adaptor/actions/runs/11744726638/job/32720502155, but I was hoping that the workflow would be run on this PR as well, so I'm not sure if I've made a mistake with it?

There is a typo on the paths filter: s/worksflows/workflows/ So it's expecting changes on wrong path. In your fork you probably triggered manually (workflow_dispatch).

Awesome - thanks for the spot I knew there was something wrong - and I did do the workflow_dispatch in my fork!

@stevenhorsman
Copy link
Member Author

stevenhorsman commented Nov 13, 2024

It's running now here: https://github.com/confidential-containers/cloud-api-adaptor/actions/runs/11819549958/job/32929721287?pr=2146. Big thank you to @wainersm!

Copy link
Member

@wainersm wainersm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @stevenhorsman !

@stevenhorsman stevenhorsman merged commit 04ccaf6 into confidential-containers:main Nov 13, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants