testing-library / dom-testing-library

πŸ™ Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.26k stars 466 forks source link

GitHub Workflows security hardening #1193

Closed sashashura closed 1 year ago

sashashura commented 1 year ago

What: This PR adds explicit permissions section to workflows.

Why: This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted.

How: It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.

Checklist:

codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7389dab33d932dc1af62947c2538d0c747738c2a:

Sandbox Source
react-testing-library-examples Configuration
codecov[bot] commented 1 year ago

Codecov Report

Merging #1193 (7389dab) into main (fe12e5b) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #1193   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          998       998           
  Branches       326       327    +1     
=========================================
  Hits           998       998           
Flag Coverage Ξ”
node-12 100.00% <ΓΈ> (ΓΈ)
node-14 100.00% <ΓΈ> (ΓΈ)
node-16 100.00% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

eps1lon commented 1 year ago

Let's see if it works.

eps1lon commented 1 year ago

This was missing issues: write for semantic-release. Fixing in https://github.com/testing-library/dom-testing-library/pull/1214