Skip to content

Pin actions to a full length commit SHA #24647

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

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

naveensrinivasan
Copy link
Contributor

Pin actions to a full length commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions

Also, dependabot supports upgrading based on SHA.

Signed-off-by: naveensrinivasan [email protected]

Other angular projects are doing similar stuff https://github.com/angular/angular-cli/blob/366cabc66c3dd836e2fdfea8dad6c4c7c2096b1d/.github/workflows/dev-infra.yml#L16

https://github.com/angular/angular/blob/8155428ba65c38c0c15f2666727202a7b360c1bd/.github/workflows/feature-requests.yml#L10

@naveensrinivasan naveensrinivasan requested a review from a team as a code owner March 23, 2022 00:22
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, can you also please fix the commit message?

cc. @clydin

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

Thank you for the quick update. Overall LGTM

@naveensrinivasan
Copy link
Contributor Author

@devversion Let me know if something else is missing. Thanks for the quick review and turnaround appreciate it!

Signed-off-by: naveensrinivasan <[email protected]>
@devversion devversion added action: merge The PR is ready for merge by the caretaker merge safe target: patch This PR is targeted for the next patch release labels Mar 23, 2022
@naveensrinivasan
Copy link
Contributor Author

@devversion What is that needed to merge this in?

@andrewseguin andrewseguin merged commit 8ae8216 into angular:master Mar 24, 2022
andrewseguin pushed a commit that referenced this pull request Mar 24, 2022
* build: Pin actions to a full length commit SHA

- Pinned actions by SHA https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

* build: Fixed the incorrect SHA's

Signed-off-by: naveensrinivasan <[email protected]>
(cherry picked from commit 8ae8216)
@naveensrinivasan naveensrinivasan deleted the naveen/feat/pin-deps branch March 24, 2022 02:24
forsti0506 pushed a commit to forsti0506/components that referenced this pull request Apr 3, 2022
* build: Pin actions to a full length commit SHA

- Pinned actions by SHA https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

* build: Fixed the incorrect SHA's

Signed-off-by: naveensrinivasan <[email protected]>
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants