Skip to content

adjusted dL for design 1, and added design 2 #104

adjusted dL for design 1, and added design 2

adjusted dL for design 1, and added design 2 #104

name: Check GDS and OAS File Submissions
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check_files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get list of changed files
id: changed_files
run: |
# Get the list of files changed in the PR
# echo "::set-output name=files::$(git diff --name-only origin/main HEAD)"
# get added/modified py files
if [ "${{ github.event_name }}" == "push" ]; then
echo "::set-output name=files::$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.sha }})"
else
echo "::set-output name=files::$(git diff --name-only --diff-filter=ACM FETCH_HEAD)"
fi
- name: Check GDS and OAS file locations and names
run: |
# Get the list of changed files from the previous step
changed_files="${{ steps.changed_files.outputs.files }}"
# Split files into an array
IFS=$'\n' read -r -d '' -a file_array <<< "$changed_files"
# Loop over the files
for file in "${file_array[@]}"; do
# Check if the file ends with .gds or .oas
if [[ "$file" == *.gds || "$file" == *.oas ]]; then
# Check if the file is in the submissions folder
if [[ "$file" != submissions/* ]]; then
echo "Error: File '$file' is not in the 'submissions' folder."
exit 1
fi
# Check if the file contains any spaces in the name
if [[ "$file" == *" "* ]]; then
echo "Error: File '$file' contains spaces in the filename."
exit 1
fi
fi
done
shell: bash
- name: Success message
if: success()
run: echo "All GDS and OAS files are correctly placed in the submissions folder and contain no spaces in their filenames."