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

feat: Add workflow_run.workflows references check #400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gmazzo
Copy link

@gmazzo gmazzo commented Feb 19, 2024

Fixes #83 by introducing a new workflow_run rule to check the existence of referenced workflows at that trigger.

This rule is a bit different than others, it will be a singleton instance for the check run (instead of one per file), to allow collecting workflow names from the whole suite.

Because of that, it can only apply when calling LintFiles (nil for other usages of the linter).
It validates that any name reference on workflow_run.workflow exists in another workflow of the same set.

on:
  workflow_run:
    types: [completed]
    workflows:
      - build
      - test # ERROR: This workflow does not exist, its name is `Tests`

image

This is my first experience working with Go, feel free to suggest any change regarding code style or best practices.

pass.go Outdated Show resolved Hide resolved
@gmazzo
Copy link
Author

gmazzo commented Mar 6, 2024

Hi @rhysd, I see there is activity in this repo. Any chance to get this one reviewed? We are currently using a forked internal version of your tool.

Great work by the way!

@gmazzo gmazzo changed the title Added workflow_run.workflows references check feat: Add workflow_run.workflows references check Apr 16, 2024
@gmazzo gmazzo force-pushed the workflow_run_refs branch 5 times, most recently from 6461b5e to 0f1ab87 Compare July 1, 2024 22:54
@gmazzo
Copy link
Author

gmazzo commented Jul 1, 2024

Hi @rhysd, I've rebased the code, simplified the solution and now all tests seem to be OK. It would be nice to hear back from you, this has been ignored for a while now :(

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.

Validate workflow_run's workflow names actually exist
1 participant