Skip to content

Semaphore V4 Ceremony #56

Semaphore V4 Ceremony

Semaphore V4 Ceremony #56

Workflow file for this run

# check that a PR modified the correct files and nothing more
name: Check PR Files
on:
pull_request:
paths:
- 'ceremonies/**'
jobs:
check-files:
runs-on: ubuntu-latest
if: endsWith(github.head_ref, '-ceremony')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get changed files
id: get-changed-files
uses: jitterbit/get-changed-files@v1
with:
format: 'csv'
- name: Validate files
run: |
changed_files="${{ steps.get-changed-files.outputs.all }}"
IFS=', ' read -r -a files <<< "$changed_files"
config_found=false
for file in "${files[@]}"; do
if [[ $file == ceremonies/$(echo $GITHUB_HEAD_REF | tr '[:upper:]' '[:lower:]')/p0tionConfig.json ]]; then
config_found=true
else
echo "Invalid file detected: $file"
exit 1
fi
done
if [[ $config_found = false ]]; then
echo "No p0tionConfig.json file found in PR."
exit 1
fi
echo "p0tionConfig.json file is present and no other files were changed."