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

ci: Improve workflow's securiy #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

masamallow
Copy link
Owner

Description of changes

This pull request includes several updates to the GitHub Actions workflows to enhance security and functionality. The most important changes involve adding permissions configurations, introducing a new workflow for pinning actions, and updating existing workflows to improve clarity and security.

Permissions Configuration:

  • .github/workflows/ci.yml: Added empty permissions object at the workflow level and specified read permissions for contents in the build-n-test job. Also, disabled credential persistence for the checkout step.
  • .github/workflows/release-prepare.yml: Replaced specific permissions with an empty permissions object at the workflow level and re-added specific permissions for the crate-release-pull-request job. Disabled credential persistence for the checkout step.
  • .github/workflows/release-publish.yml: Added an empty permissions object at the workflow level and changed contents permissions from write to read in the release job. Disabled credential persistence for the checkout step.

New Workflow:

  • .github/workflows/pinact.yml: Introduced a new workflow named "Pinact" to pin actions used in the repository. This includes setting up permissions, specifying the branch to trigger on, and defining steps for checking out the code and pinning actions.

Additional Improvements:

@masamallow masamallow requested a review from Copilot March 25, 2025 09:48
@masamallow masamallow self-assigned this Mar 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the security and clarity of the GitHub Actions workflows. The key changes include:

  • Standardized and tightened permission settings along with disabling credential persistence in workflows.
  • Introduction of a new workflow ("Pinact") for pinning repository actions.
  • Update to the release preparation process by adding a signing flag to the cargo release command.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/pinact.yml New workflow for pinning actions with updated security settings
.github/workflows/release-prepare.yml Updated permissions configuration and release signing is now enabled
.github/workflows/release-publish.yml Adjusted permissions for the release job to reduce risk of unintended modifications
.github/workflows/ci.yml Standardized workflow permissions and improved the checkout security options
Comments suppressed due to low confidence (2)

.github/workflows/release-prepare.yml:72

  • Verify that the '--sign' flag is supported in the current environment and ensure that any prerequisites for signing releases are clearly documented.
--sign \

.github/workflows/release-publish.yml:15

  • [nitpick] Double-check that reducing the permissions to 'read' will not affect any subsequent steps that might need write access.
contents: read

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.

1 participant