-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate steps to bump version in pull request action into a separate…
… job (#342)
- Loading branch information
Showing
2 changed files
with
18 additions
and
10 deletions.
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,5 +1,7 @@ | ||
name: Dr Header Pull Request handler | ||
name: Pull Request Handler | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -8,15 +10,15 @@ jobs: | |
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout Code | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install PIP Dependencies | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements_dev.txt | ||
|
@@ -41,23 +43,30 @@ jobs: | |
- name: Run SCA scan | ||
run: tox run -e sca | ||
|
||
- name: Checkout origin branch if PR 'to-branch' is master | ||
if: github.base_ref == 'master' | ||
bump-version: | ||
if: github.base_ref == 'master' | ||
needs: build | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
pip install bump2version==1.0.1 | ||
- name: Checkout head branch | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: BumpVersion if PR 'to-branch' is master | ||
if: github.base_ref == 'master' | ||
- name: Bump version | ||
run: | | ||
grep -i 'current_version = ' setup.cfg | head -1 | tr -d 'current_version = ' | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
bump2version minor | ||
grep -i 'current_version = ' setup.cfg | head -1 | tr -d 'current_version = ' | ||
- name: Push changes if PR 'to-branch' is master | ||
if: github.base_ref == 'master' | ||
- name: Push changes to origin | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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,4 +1,3 @@ | ||
bump2version==1.0.1 | ||
wheel==0.41.3 | ||
watchdog==3.0.0 | ||
tox==4.11.3 | ||
|