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

Improve security of GitHub Actions workflows #2510

Merged
merged 47 commits into from
Apr 16, 2024

Conversation

KevinEyo1
Copy link
Contributor

@KevinEyo1 KevinEyo1 commented Apr 9, 2024

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
Fixes #2488
Refactor code and improve security of workflows based on research on security best practices

Anything you'd like to highlight/discuss:
Removed explicit stating of GITHUB_TOKEN in ci.yml, not sure if there is a need for it as there is no documentation of why it was added.

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)
GitHub Actions: improve security

Security best practices need to be enforced to ensure no avenues
of attack and security breaches.

Let's update the workflows following security best practices,
particularly restricting permissions to read permissions


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

KevinEyo1 and others added 30 commits January 29, 2024 13:25
This reverts commit 936dadc.
@KevinEyo1 KevinEyo1 marked this pull request as ready for review April 9, 2024 09:08
@KevinEyo1
Copy link
Contributor Author

KevinEyo1 commented Apr 10, 2024

Test ci.yml:
Passes tests
Test description body:
Removed description, check runs and fails. Add back and check runs and passes.
Test PR Merge
Updated job runs
No impact selected and fails
2 impacts selected and fails
r.Major selected and passes

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.00%. Comparing base (ff8e9b1) to head (8b185c3).

❗ Current head 8b185c3 differs from pull request most recent head b199f86. Consider uploading reports for the commit b199f86 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2510   +/-   ##
=======================================
  Coverage   51.00%   51.00%           
=======================================
  Files         124      124           
  Lines        5384     5384           
  Branches     1162     1162           
=======================================
  Hits         2746     2746           
  Misses       2348     2348           
  Partials      290      290           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@yucheng11122017 yucheng11122017 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 the work @KevinEyo1! This is pretty awesome - thank you for doing the research and implementing this.
Just one small nit and I think we should be good to go.

.github/workflows/pr-merge.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@kaixin-hc kaixin-hc left a comment

Choose a reason for hiding this comment

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

LGTM!

I amended the PR message slightly - I think "Make updates for security" is super vague", so I added that mainly what was done was restrict permissions to read. Can the merger amend it if there are other details I missed?

Copy link
Contributor

@yucheng11122017 yucheng11122017 left a comment

Choose a reason for hiding this comment

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

LGTM!

@yucheng11122017 yucheng11122017 merged commit f1c365c into MarkBind:master Apr 16, 2024
7 checks passed
@github-actions github-actions bot added the r.Patch Version resolver: increment by 0.0.1 label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r.Patch Version resolver: increment by 0.0.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve security of GitHub Actions workflows
5 participants