👷 CI: Add the stash apply to apply the changes directly #23
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: 🤖 Automated Bump PR 🔖 | |
on: | |
push: | |
branches: | |
- main | |
# -------------------------------------------------------------------------- # | |
# To use this Workflow, you need to specify this line on your job: # | |
# uses: ricardoleal20/sempyver/.github/workflows/open_pull_request.yml@main # | |
# -------------------------------------------------------------------------- # | |
workflow_call: | |
# Generate the jobs for this | |
jobs: | |
# Name of the main job for this | |
bump_and_open_pr: | |
runs-on: ubuntu-latest | |
steps: | |
# Check the code to see the differences | |
- name: Checkout code 🧑💻 | |
uses: actions/checkout@v3 | |
- name: Set Git user globally to github-actions ⑆ | |
uses: gotmax23/set-bot-git-user-action@main | |
with: | |
global: true | |
bot: github-actions | |
name: "Github Actions" | |
- name: Set up Python 🐍 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies 🏗️ | |
run: | | |
pip install poetry | |
poetry install | |
poetry run pip install PyGithub | |
poetry run pip install maturin | |
poetry run maturin develop | |
- name: Perform changeset changes | |
run: | | |
poetry run sempyver bump | |
- name: Run Python script for open the new branch and the PR 🖥️ | |
run: poetry run python .github/utilities/open_pr.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH_NAME: ${{ github.ref }} | |
REPO_NAME: ${{ github.repository }} | |
- name: Add changed files with Git 🔍 | |
run: | | |
git pull | |
git stash | |
git checkout bump-new-version | |
git pull origin | |
git stash apply --index | |
git add --all | |
git commit -m "🔖 Tag: Bump new project version using Sempyver" | |
git push | |
# If the linter pass | |
- run: echo "The PR has been open! ✅" |