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

Create a workflow for checks on static files #950

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/check-static-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check changes to static files

on:
pull_request:
branches:
- main

jobs:
changed_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: List changed frontend source files
uses: tj-actions/changed-files@v44
id: changed-frontend-src-files
with:
files: |
frontend/src/**/*.tsx
frontend/src/**/*.css

- name: List changed frontend static files
id: changed-frontend-static-files
if: steps.changed-frontend-src-files.outputs.files_changed == 'true'
uses: tj-actions/changed-files@v44
with:
files: |
static

- name: Check changed static files
if: steps.changed-frontend-src-files.outputs.files_changed == 'true' && steps.changed-frontend-static-files.outputs.files_changed == 'false'
run: echo "There were changes to the frontend code, but no corresponding changes to static files. Please build the project locally, commit the static file changes and push the changes to try again." && exit 1

- name: List logo customizations
uses: tj-actions/changed-files@v44
id: changed-logo-files
with:
files: |
frontend/public/favicon.ico
frontend/src/assets

- name: Comment on logo customizations
if: steps.changed-logo-files.outputs.any_changed == 'true'
uses: mshick/add-pr-comment@v2
with:
message: |
"Hello contributor, it appears that your pull request contains some customizations to branding. We are unable to approve your PR at this time. If you believe this message to be in error, please correct these unsupported changes and try again, or reach out to one of the maintainers of the repo to discuss the changes."

- name: Fail on logo customizations
if: steps.changed-logo-files.outputs.any_changed == 'true'
run: echo "Logos are customized, which is not a supported change." && exit 1
Loading