CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
73 stars 40 forks source link

Importing JosiahSiegel GHA: randomrepo@v1.1 #16158

Open emvaldes opened 2 months ago

emvaldes commented 2 months ago

Profile: JosiahSiegel Status: Under Consideration (Pending)

Objective: This action is useful for running actions against random repositories. e.g. leak scanner, etc.

Target: randomrepo@v1.1 : 443cdca

Warning: Generated fron JosiahSiegel/hello-world-docker-action

The randomrepo-action is a GitHub Action designed to fetch the name of a random public GitHub repository. This functionality can be useful for workflows that require interaction with random repositories, such as testing tools or scanners.

Key Features:

Inputs:

Outputs:

Technical Evaluation:

The action is implemented using a Docker container that runs a script to perform the following steps:

  1. Authentication: Utilizes the provided GitHub token to authenticate API requests.
  2. Repository Retrieval: Sends a request to the GitHub API to fetch a list of public repositories.
  3. Random Selection: Randomly selects a repository from the retrieved list.
  4. Output Assignment: Sets the repo output variable with the name of the selected repository.

Usage Example:

jobs:
  fetch-random-repo:
    runs-on: ubuntu-latest
    steps:
      - name: Fetch Random Repository
        id: random-repo
        uses: JosiahSiegel/randomrepo@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Output Random Repository
        run: echo "Random repository: ${{ steps.random-repo.outputs.repo }}"

Relevance to Your Pipeline:

If your pipeline includes processes that require interaction with random public repositories—such as testing tools, scanners, or educational purposes—this action can automate the selection process, enhancing efficiency. However, if your workflow does not involve such scenarios, this action may be considered non-essential.

Conclusion:

The randomrepo-action provides a straightforward method to fetch the name of a random public GitHub repository within a workflow. Its utility is contingent upon your pipeline's specific requirements for random repository selection. Evaluating your current processes will help determine the action's relevance to your workflows.

emvaldes commented 2 months ago

This external repo is now inserted in the file structure at: .github/actions/randomrepo in the importing-gha branch.

emvaldes commented 1 month ago
inputs.github-token
secrets.GITHUB_TOKEN
steps.random.outputs.repo
emvaldes commented 1 month ago

This GitHub Action (targeted to be imported as a remote/external) is no longer in consideration until we can further evaluate if they are worth the effort to be imported at a later stage.

Warning: I have placed it into the "IceBox" stage as it is out of scope for now.