Skip to content

Commit

Permalink
Only run copyright CI when merging into main (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
maltekliemann authored Feb 24, 2024
1 parent eb2621a commit 8bd8fa5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 25 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/copyright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Copyright

on:
pull_request:
types: [ labeled ]
branches: [ main ]
push:
branches: [ main ]

jobs:
copyright:
name: Copyright Notices
if: |
github.event_name == 'pull_request' &&
(contains(github.event.pull_request.labels.*.name, 's:review-needed') ||
contains(github.event.pull_request.labels.*.name, 's:accepted')) ||
github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: Install check-license and dependencies
run: |
pip install scripts/check-license
pip install -r scripts/check-license/requirements.txt
- name: Query files changed
id: files_changed
uses: Ana06/get-changed-files@v1.2
with:
filter: '*.rs$'
- name: Check copyright notices
run: check-license ${{ steps.files_changed.outputs.added_modified }}
25 changes: 0 additions & 25 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,6 @@ jobs:
- name: Format
run: ./scripts/tests/format.sh --check

copyright:
name: Copyright Notices
if: |
github.event_name == 'pull_request' &&
(contains(github.event.pull_request.labels.*.name, 's:review-needed') ||
contains(github.event.pull_request.labels.*.name, 's:accepted')) ||
github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: Install check-license and dependencies
run: |
pip install scripts/check-license
pip install -r scripts/check-license/requirements.txt
- name: Query files changed
id: files_changed
uses: Ana06/get-changed-files@v1.2
with:
filter: '*.rs$'
- name: Check copyright notices
run: check-license ${{ steps.files_changed.outputs.added_modified }}

checks:
name: Checks
if: |
Expand Down

0 comments on commit 8bd8fa5

Please sign in to comment.