-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.95 KB
/
open_pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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:
secrets:
CUSTOM_GITHUB_TOKEN:
description: "Token for be able to open Pull Requests and perform commits"
required: true
# 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.CUSTOM_GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.ref }}
REPO_NAME: ${{ github.repository }}
- name: Add changed files with Git 🔍
run: |
git pull
git checkout bump-new-version
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! ✅"