-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from FeatureLabs/add_readme
Add documentation to Readme
- Loading branch information
Showing
1 changed file
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,81 @@ | ||
# minimum-dependency-generator | ||
# GitHub Action - Minimum Dependency Generator | ||
|
||
A GitHub Action to generate minimum Python dependencies. | ||
|
||
## Usage | ||
|
||
This GitHub Action provides a task to generate the minimum Python given 1 or more requirement files. | ||
|
||
```yaml | ||
steps: | ||
- name: Run Minimum Dependency Generator | ||
id: min_dep_gen | ||
uses: alteryx/minimum-dependency-generator@v1 | ||
with: | ||
requirements_paths: 'test-requirements.txt requirements.txt' | ||
- name: Save the output minimum requirements | ||
run: printf "${{ steps.min_dep_gen.outputs.min_reqs }}" >> generated-min-reqs.txt | ||
``` | ||
The returned value of a task is available in later steps from the output `min_reqs`. | ||
|
||
``` | ||
steps.<step id>.outputs.min_reqs | ||
``` | ||
## Example | ||
This workflow uses the task to generate minimum dependencies, save the output to a text file, and then will generated an Automated MR if there is a change in the minimum dependencies. | ||
```yaml | ||
# minimum_dependency_checker.yml | ||
name: Minimum Dependency Checker | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'requirements.txt' | ||
- 'test-requirements.txt' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
- name: Set up python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Run Minimum Dependency Generator | ||
id: min_dep_gen | ||
uses: alteryx/minimum-dependency-generator@v1 | ||
with: | ||
requirements_paths: 'test-requirements.txt requirements.txt' | ||
- name: Update minimum core dependencies | ||
run: | | ||
printf "${{ steps.min_dep_gen.outputs.min_reqs }}" >> woodwork/tests/minimum_requirements.txt | ||
- name: Create Pull Request | ||
uses: FeatureLabs/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.REPO_SCOPED_TOKEN }} | ||
commit-message: Update minimum dependencies | ||
title: Automated Minimum Dependency Updates | ||
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
body: "This is an auto-generated PR with **minimum** dependency updates. | ||
Please do not delete the `min-dep-update` branch because it's needed by the auto-dependency bot." | ||
branch: min-dep-update | ||
branch-suffix: short-commit-hash | ||
base: main | ||
``` | ||
|
||
To install this workflow, add the file above to the following location in your repository. | ||
|
||
``` | ||
.github | ||
└── workflows | ||
└── minimum_dependency_check.yml | ||
``` |