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

feat: enable and disable automated security features #1705

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

jprosevear
Copy link
Contributor

Resolves #1704


Before the change?

  • N/A

After the change?

  • Enable, disable and check status of automated security fixes

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

  • Yes
  • No

Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@@ -609,4 +609,38 @@
expect(result).to be true
end
end # .disable_vulnerability_alerts

describe '.automated_security_fixes_enabled?', :vcr do
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this come with VCR updates?

I'm not sure why I'm not seeing the prompt to approve the Actions test run; perhaps it has something to do with the new merge box UI. Either way, I'd expect these tests to need VCR updates to pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should, i misunderstood the process. Now attached.

@jprosevear jprosevear force-pushed the feat/automated-security-fixes branch from 75fc060 to 843ea20 Compare July 18, 2024 13:44
# @example
# @client.automated_security_fixes_enabled?("octokit/octokit.rb")
def automated_security_fixes_enabled?(repo, options = {})
response = get "#{Repository.path repo}/automated-security-fixes", options
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not a boolean_from_response capable endpoint; it always returns 200 with an object:

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository

Note that unlike the docs, it does not return 404 if not enabled, it always returns the object (with enabled: false).

@nickfloyd nickfloyd merged commit 301bb57 into octokit:main Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[FEAT]: Enable and disable automated security fixes on a repo
3 participants