Skip to content

Commit

Permalink
Merge pull request #2 from github/zkoppert-patch-1
Browse files Browse the repository at this point in the history
Add badges
  • Loading branch information
zkoppert authored Dec 15, 2023
2 parents 5804159 + 9946a0e commit 7a2d62e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Evergreen action

[![CodeQL](https://github.com/github/evergreen/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/github/evergreen/actions/workflows/github-code-scanning/codeql) [![Lint Code Base](https://github.com/github/evergreen/actions/workflows/super-linter.yaml/badge.svg)](https://github.com/github/evergreen/actions/workflows/super-linter.yaml) [![Python package](https://github.com/github/evergreen/actions/workflows/python-ci.yml/badge.svg)](https://github.com/github/evergreen/actions/workflows/python-ci.yml)

This is a GitHub Action that given an organization or specified repositories, opens an issue/PR dependabot is not enabled but could be.

This action was developed by the GitHub OSPO for our own use and developed in a way that we could open source it that it might be useful to you as well! If you want to know more about how we use it, reach out in an issue in this repository.
Expand Down
3 changes: 1 addition & 2 deletions dependabot_file.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""This module contains the function to build the dependabot.yml file for a repo"""


import github3


def build_dependabot_file(repo) -> str:
def build_dependabot_file(repo) -> str | None:
"""
Build the dependabot.yml file for a repo based on the repo contents
Expand Down
18 changes: 10 additions & 8 deletions env.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def get_env_vars() -> (
tuple[str | None, list[str], str, str, list[str], str, str, str, int | None]
tuple[str | None, list[str], str, str, list[str], str, str, str, str | None]
):
"""
Get the environment variables for use in the action.
Expand All @@ -18,13 +18,15 @@ def get_env_vars() -> (
None
Returns:
str: the organization to get contributor information for
List[str]: A list of the repositories to get contributor information for
str: the GitHub token to use for authentication
str: the GitHub Enterprise URL to use for authentication
str: the start date to get contributor information from
str: the end date to get contributor information to.
str: whether to get sponsor information on the contributor
organization (str): The organization to search for repositories in
repository_list (list[str]): A list of repositories to search for
token (str): The GitHub token to use for authentication
ghe (str): The GitHub Enterprise URL to use for authentication
exempt_repositories_list (list[str]): A list of repositories to exempt from the action
follow_up_type (str): The type of follow up to open (issue or pull)
title (str): The title of the follow up
body (str): The body of the follow up
created_after_date (str): The date to filter repositories by
"""
# Load from .env file if it exists
Expand Down
2 changes: 1 addition & 1 deletion evergreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import uuid

import github3
import auth
import env
import github3
from dependabot_file import build_dependabot_file


Expand Down
4 changes: 1 addition & 3 deletions test_dependabot_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import unittest
from unittest.mock import MagicMock

from dependabot_file import (
build_dependabot_file,
)
from dependabot_file import build_dependabot_file


class TestDependabotFile(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test_env.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the get_env_vars function"""
import os
import unittest
from unittest.mock import patch
import os

from env import get_env_vars

Expand Down

0 comments on commit 7a2d62e

Please sign in to comment.