Implement automatic package updates #14
Workflow file for this run
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
name: update-package | |
on: | |
# workflow_dispatch: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
# Disallow running on events triggered by a fork | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
steps: | |
- name: Checkout package | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install -U pip | |
pip install mypy | |
mkdir ../pydicom | |
git clone https://github.com/pydicom/pydicom ../pydicom | |
pip install -e ../pydicom | |
- name: Update package | |
run: | | |
python scripts/update_package.py | |
git add src/pydicom-stubs | |
git status | |
- name: Create Pull Request | |
# Only creates a new PR if there are changes | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.AUTO_UPDATE_PACKAGE }} | |
title: "Update package" | |
# If workflow is running from `pull_request` | |
base: ${{ github.head_ref }} | |
# If workflow is running from `release` | |
# base: main |