Skip to content

Conversation

sebastienvermeille
Copy link

What are the incoming changes?

The following changes integrate a new property into the report: actionRef

Why named action ref?

Can be challenged, I thought it's a good idea as after the @ it can be many different things actually:

actions@<SHA | tag | version> < --- Due to that, I think that naming actionVersion actionTag actionSha is not really a good choice.

Let me know if you get a better idea 👍

Why are they needed

#106

How has this been achieved?

I added the property and tested it on my own workflows it worked like a charm.

It creates one entry per action:ref (= if an action is used with 4 different refs in the GitHub organization, it will be in 4 different "action's" in the report)

This helps to identify which repositories are using actions, including vulnerabilities (i.e version 2 contains an important CVE but 3 fix it)

These are my first line in Powershell, I am very happy to hear your feedback about that change 👍

@sebastienvermeille sebastienvermeille force-pushed the feat/add-option-to-include-versions-tags-in-report branch from dcb58d4 to 26caace Compare June 25, 2024 15:18
@sebastienvermeille
Copy link
Author

Hi @rajbos, could you have a look at this PR and let me know if some changes are required?

Thank you 👍

Copy link
Collaborator

@rajbos rajbos left a comment

Choose a reason for hiding this comment

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

Great stuff @sebastienvermeille! Thanks for the PR.

I prefer to add the new field to the workflows array instead of the output array. Adding it to the output array and thus having multiple items for each usage of the action, would mean introducing a breaking change for dependencies of this action (like my actions marketplace).

If we add the new property in the workflows array we now have a non breaking change, but still get the 'version' information out of it.

And note: great name for the property, that is just a good reasoning indeed!

Do you want to create the changes yourself, or need some help?

Sebastien Vermeille and others added 4 commits July 5, 2024 13:54
Co-authored-by: Rob Bos <rajbos@users.noreply.github.com>
Co-authored-by: Rob Bos <rajbos@users.noreply.github.com>
@sebastienvermeille sebastienvermeille force-pushed the feat/add-option-to-include-versions-tags-in-report branch from ed0b9fc to ab6caa3 Compare July 5, 2024 11:54
@sebastienvermeille sebastienvermeille deleted the feat/add-option-to-include-versions-tags-in-report branch July 5, 2024 11:55
@sebastienvermeille sebastienvermeille restored the feat/add-option-to-include-versions-tags-in-report branch July 5, 2024 11:55
@sebastienvermeille
Copy link
Author

sebastienvermeille commented Jul 5, 2024

I prefer to add the new field to the workflows array instead of the output array. Adding it to the output array and thus having multiple items for each usage of the action, would mean introducing a breaking change for dependencies of this action (like my actions marketplace).

If we add the new property in the workflows array we now have a non breaking change, but still get the 'version' information out of it.

Hi @rajbos , this is a totally valid point of view (mine was maybe biased because it was easier for me to dump it to Datadog with this format so I could easily sort out which gh-action versions are used where but I can still rework the data after no worries)

Do you want to create the changes yourself, or need some help?

I will give it a try 👍

That way it is a non breaking change for existing consumers
@sebastienvermeille
Copy link
Author

Hi @rajbos , I applied the requested changes,
I tested it and could see the expected results happening:

    {
        "type": "action",
        "actionLink": "someorg/some-action",
        "count": 1,
        "workflows": [
            {
                "repo": "someorg/test",
                "workflowFileName": "build.yml",
                "actionRef": "v3"
            }
        ]
    },
...

I will probably need to do some remapping with my Datadog monitoring as I want to see "which repo are using compromised version of GitHub actions" but this is another topic for my own :D

Wish you a good weekend ahead!

🖖

@sebastienvermeille sebastienvermeille requested a review from rajbos July 5, 2024 14:06
Copy link
Collaborator

@rajbos rajbos left a comment

Choose a reason for hiding this comment

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

I added the change to include the actionRef in the workflows array.

@rajbos
Copy link
Collaborator

rajbos commented Jul 8, 2024

Thanks for adding this! Great work @sebastienvermeille 🎉

@rajbos rajbos merged commit f056c6e into devops-actions:main Jul 8, 2024
@sebastienvermeille
Copy link
Author

Thank you for your help @rajbos, very happy to contribute to a such great project 👍

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.

2 participants