Skip to content

For actions that are pinned-by-hash, bump the human readable version number in the code comment #4691

@ChrisCarini

Description

@ChrisCarini

Hello!

As good security practice and guided by the code scanning alert for 'Pinned-Dependencies' from the ossf/scorecard project, users are encouraged to pin GitHub workflow actions by hash. The example provided by the scorecard repoincludes a comment following the action+pinned-hash, example below:

     - name: Clone the code
       uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

Subsequent updates by dependabot do not bump the version in the comment, leading to confusion and incorrect information. An example of this can be found here: ChrisCarini/environment-variable-settings-summary-intellij-plugin#36

Below is a before & after example of the above linked PR

Before

Screen Shot 2022-01-31 at 22 53 54

After

Screen Shot 2022-01-31 at 22 52 13

Summary

Dependabot updated ossf/scorecard-action from version v1.0.1 to v1.0.2.

In the "Before", the hash was updated correctly, however the trailing comment with the tag version, was not.

Hash Tag Version
e3e75cf2ffbf9364bbff86cdbdf52b23176fe492 v1.0.1
c8416b0b2bf627c349ca92fc8e3de51a64b005cf v1.0.2

I believe this change would help GitHub workflow owners to have a better security posture w.r.t. using hash-pinned GitHugb action dependencies, while also having improved ergonomics to be able to quickly verify they are on the correct version.

This idea shares similar sentiment of #3699

(I would consider trying to make a code change for this, however I lack expertise in Ruby and have thus far struggled to get the project opened for development.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions