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
72 stars 40 forks source link

Importing JosiahSiegel GHA: reliable-pull-request-action@v1.2.0 #16159

Open emvaldes opened 1 month ago

emvaldes commented 1 month ago

Profile: JosiahSiegel Objective: Creates a pull request on a GitHub repository using existing branches and then by executing the actions/checkout determines the active repo.

Target: reliable-pull-request-action@v1.2.0 : ae8d0c8

The reliable-pull-request-action is a GitHub Action designed to automate the creation of pull requests (PRs) between existing branches within a repository. This action is particularly useful in continuous integration and deployment pipelines where automated PR generation is required.

Key Features:

Inputs:

Outputs:

Technical Evaluation:

The action is implemented as a composite action, executing a shell script (create-pr.sh) to perform the PR creation process. The script utilizes GitHub's REST API to create the pull request and handles the following steps:

  1. Environment Setup: Configures necessary environment variables, including the GitHub token for authentication.
  2. API Request: Constructs and sends a POST request to GitHub's API to create the pull request with the specified parameters.
  3. Response Handling: Processes the API response to determine the success of the PR creation and extracts the URL of the created PR.
  4. Output Assignment: Sets the PRURL output with the URL of the newly created pull request.

Usage Example:

jobs:
  create-pr:
    name: Test create PR on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
    steps:
      - name: Checkout the repo
        uses: actions/checkout@v4.1.1
      - name: Create Pull Request
        id: create_pr
        uses: JosiahSiegel/reliable-pull-request-action@v1.0.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          title: 'Automated Pull Request'
          sourceBranch: ${{ github.ref_name }}
          targetBranch: 'main'
          body: 'This is an automated pull request.'
          labels: 'automated,pr'
          assignees: 'octocat'
      - name: Output PR URL
        run: echo "The PR URL is ${{ steps.create_pr.outputs.PRURL }}"

Relevance to Your Pipeline:

If your pipeline involves scenarios where automated pull request creation is beneficial—such as promoting changes between branches, initiating code reviews, or integrating feature branches—this action can streamline the process and reduce manual effort. However, if your workflow does not require automated PR creation or if such tasks are managed through other means, this action may be considered non-essential.

Conclusion:

The reliable-pull-request-action offers a reliable method for automating pull request creation within GitHub workflows. Its utility depends on your pipeline's specific requirements for PR automation. Evaluating your current processes for managing pull requests will help determine the action's relevance to your workflows.

emvaldes commented 1 month ago

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

emvaldes commented 1 month ago
github.action_path
github.actor
github.ref_name
github.ref_name.
inputs.assignees
inputs.body
inputs.labels
inputs.sourceBranch
inputs.targetBranch
inputs.title
matrix.os
secrets.GITHUB_TOKEN
steps.create_pr.outputs.PRURL
steps.create_pr.outputs.PR_URL
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.