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

Add token-permissions to CI workflow #865

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

lucacome
Copy link
Member

@lucacome lucacome commented Jul 14, 2023

Proposed changes

Problem: Permissions were not set for the CI workflow

Solution: Add permissions to the workflow to limit the scope of the GITHUB_TOKEN and grant only the extra permissions needed for the specific job. This also removes the separate release job and requires tests to pass before executing the release step.

Closes #837

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@lucacome lucacome self-assigned this Jul 14, 2023
@lucacome lucacome requested a review from a team as a code owner July 14, 2023 17:44
@github-actions github-actions bot added the chore Pull requests for routine tasks label Jul 14, 2023
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@lucacome lucacome requested a review from a team July 18, 2023 21:51
@sjberman
Copy link
Contributor

So the release draft step is now nested under the build binary step?

@lucacome
Copy link
Member Author

@sjberman it was in the binary step before, then I moved it to its own job to wait for the tests, but I don't think it makes sense to create an additional job for the release. Also it's a requirement for the build on release, but because the job is skipped on PRs we can't enforce it in the build job.
I think having it as part of the build and just adding unit-tests, njs-unit-tests as a requirement for the job makes more sense. What do you think?

Copy link
Contributor

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

LGTM

Adds permissions to the workflow and reduces number of jobs steps
@lucacome lucacome dismissed ciarams87’s stale review July 21, 2023 16:47

conformance tests were moved to a different workflow

@lucacome lucacome merged commit 9fcfb83 into nginxinc:main Jul 21, 2023
17 checks passed
@lucacome lucacome deleted the chore/add-permissions-ci branch July 21, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Fix code scanning alert - Token-Permissions
4 participants