Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework trigger workflows strategy #441

Merged
merged 4 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Build

on:
push:
branches:
- develop
- main
- 'feature/**'
- 'release/**'
- 'fix/**'
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- 'dependabot/**'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

Expand All @@ -32,10 +32,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v3.3.0

- name: Set up Python 3.10
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.5.0
with:
python-version: '3.10'

Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v3.3.0

- name: Set up Python 3.10
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.5.0
with:
python-version: '3.10'

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/change-pr-target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Make sure new PRs are sent to develop

on:
pull_request_target:
types: [opened, edited]

jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- uses: Vankka/pr-target-branch-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: main
exclude: develop # Don't prevent going from develop -> main
change-to: develop
comment: |
Your PR was set to target `main`, PRs should be target `develop`
The base branch of this PR has been automatically changed to `develop`, please check that there are no merge conflicts.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: CI

on:
push:
branches:
- develop
- main
- 'feature/**'
- 'release/**'
- 'fix/**'
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- 'dependabot/**'

# The branches below must be a subset of the branches above
pull_request:
Expand Down Expand Up @@ -68,12 +68,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v3.3.0
with:
fetch-depth: 5

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.5.0
with:
python-version: ${{ matrix.python }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v3.3.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: CS

on:
push:
branches:
- develop
- main
- 'feature/**'
- 'release/**'
- 'fix/**'
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- 'dependabot/**'

pull_request:
branches:
Expand All @@ -25,10 +25,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v3.3.0

- name: Set up Python 3.10
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.5.0
with:
python-version: '3.10'

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Docs

on:
push:
branches:
- develop
- main
- 'feature/**'
- 'release/**'
- 'fix/**'
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- 'dependabot/**'

# The branches below must be a subset of the branches above
pull_request:
Expand All @@ -26,10 +26,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v3.3.0

- name: Set up Python 3.10
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.5.0
with:
python-version: '3.10'

Expand Down