Add workflow to ensure package version has been updated #4
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: Ensure version has been updated | |
on: | |
pull_request: | |
branches: master | |
jobs: | |
target-version: | |
name: Target branch version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
ref: ${{ github.base_ref }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- id: version | |
run: | | |
pip install . | |
echo "version=$(pip show requests | grep "Version:" | cut -d " " -f 2)" >> "$GITHUB_OUTPUT" | |
new-version: | |
name: Current branch version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- id: version | |
run: | | |
pip install . | |
echo "version=$(pip show requests | grep "Version:" | cut -d " " -f 2)" >> "$GITHUB_OUTPUT" | |
check-version: | |
name: Package version updated | |
runs-on: ubuntu-latest | |
needs: [target-version, new-version] | |
steps: | |
- env: | |
TARGET_VERSION: ${{ needs.target-version.outputs.version }} | |
NEW_VERSION: ${{ needs.new-version.outputs.version }} | |
run: | | |
[ "$TARGET_VERSION" != "$NEW_VERSION" ] |