-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add external_pr.yml and fix pull_request.yml
- Loading branch information
Showing
4 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Validate external Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
LOCAL_PR: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
|
||
jobs: | ||
variables: # env variables are not accessible through job.if (https://stackoverflow.com/q/73558652) | ||
runs-on: ubuntu-latest | ||
outputs: | ||
LOCAL_PR: ${{ steps.init.outputs.LOCAL_PR }} | ||
steps: | ||
- name: Make environment variables global | ||
id: init | ||
run: | | ||
echo "LOCAL_PR=${{ env.LOCAL_PR }}" >> $GITHUB_OUTPUT | ||
isort: | ||
needs: variables | ||
# if PR is external, trigger the tests on push or new PR | ||
if: ${{ needs.variables.outputs.LOCAL_PR == 'false'}} | ||
uses: ./.github/workflows/isort.yml | ||
black: | ||
needs: variables | ||
if: ${{ needs.variables.outputs.LOCAL_PR == 'false' }} | ||
uses: ./.github/workflows/black.yml | ||
build: | ||
needs: variables | ||
if: ${{ needs.variables.outputs.LOCAL_PR == 'false' }} | ||
uses: ./.github/workflows/build.yml | ||
docs: | ||
needs: variables | ||
if: ${{ needs.variables.outputs.LOCAL_PR == 'false' }} | ||
uses: ./.github/workflows/docs.yml |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,16 @@ | ||
name: Validate Pull Request | ||
name: Validate Pull Request Name | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, edited] | ||
types: [edited, opened, reopened] | ||
|
||
jobs: | ||
validate-pr-title: | ||
# Trigger only for local PR when PR is edited (title, description, etc.) | ||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: PR Conventional Commit Validation | ||
uses: ytanikin/[email protected] | ||
with: | ||
task_types: '["feat","fix","docs","test","ci","refactor","perf","revert"]' | ||
|
||
preview-docs: | ||
runs-on: ubuntu-latest | ||
if: github.event.action != 'edited' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check modifications on docs | ||
uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
docs: # name of the filter | ||
- 'docs/**' | ||
- name: Preview Readthedocs | ||
if: steps.filter.outputs.docs == 'true' | ||
uses: readthedocs/actions/preview@v1 | ||
with: | ||
project-slug: "bsb" |