Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
eye

GitHub Action

PR dependency management

0.5.0

PR dependency management

eye

PR dependency management

Manage dependency between PR using the Depends-On keyword

Installation

Copy and paste the following snippet into your .yml file.

              

- name: PR dependency management

uses: depends-on/[email protected]

Learn more about this action in depends-on/depends-on-action

Choose a version

depends-on-action

GitHub action to install dependent Pull Requests and configure them to be used by later steps.

Overview

This action allows you to install Pull Request dependencies when the workflow action is triggered.

The action is extracting all the Pull Requests that are declared in the description of the Pull Request with Depends-On: <PR url> syntax.

If you need to specify a subdir for a particular PR, use the following syntax:

Depends-On: <PR url>?subdir=<subdir path>

It then injects the needed changes in the code to use the other Pull Requests.

Go lang

For a go lang change, the action is adding replace directives for the dependencies inside the go.mod file. It is not running go mod tidy and it is expecting it to be run by your build automation in a later stage.

Python

For a Python change, the action is replacing entries in requirements.txt with a -e <local change> or the equivalent for pyproject.toml.

Enabling the action

Sample Configuration

Defining Github Actions requires that you create a directory .github/workflows inside your repository. Inside this directory you create files which are processed when various events occur.

The simplest example of using this action would be to create the file .github/workflows/pull_request.yml with the following contents:

---
name: Pull Request
on:
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  validate-tests:
    runs-on: ubuntu-latest
    steps:

      - name: Checkout code
        uses: actions/checkout@master

      - name: Extract dependent Pull Requests
        uses: depends-on/depends-on-action@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      # <your usual actions here>

  check-all-dependencies-are-merged:
    runs-on: ubuntu-latest
    steps:

      - name: Checkout code
        uses: actions/checkout@master

      - name: Check all dependent Pull Requests are merged
        uses: depends-on/depends-on-action@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          check-unmerged-pr: true
...

Roadmap