Skip to content

PR to test failure in added pictures #73

PR to test failure in added pictures

PR to test failure in added pictures #73

name: Own Files Only
# this workflow checks whether a pull request changes only files in the project folder"
# PR Titles have to start with the Project ID! (e.g. B1: ....)
on:
pull_request:
workflow_dispatch:
jobs:
check-own-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: info
run: |
echo "${{ toJSON(github.event.pull_request) }}"
- name: curl
continue-on-error: true
id: diff_files
run: |
curl -L ${{ github.event.pull_request.diff_url }} > tmp/pull_request.diff
cat tmp/pull_request.diff | grep -e "^diff --git a/" | sed -e "s#diff --git a/##g" > tmp/changed_files.txt
echo "-----"
echo cat tmp/changed_files.txt
echo "-----"
changed_files=$(cat changed_files | tr '\n' ':')
echo changed_files=$changed_files
echo changed_files=$changed_files >> $GITHUB_OUTPUT
- name: extract project id
continue-on-error: true
id: extract_pid
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
project_id=$(bin/extract_pid_from_pr_title.sh $PR_TITLE)
pid_ok=$?
echo "project_id=$project_id" >> $GITHUB_OUTPUT
exit $pid_ok
- name: curl2
continue-on-error: true
id: diff_files2
run: |
changed_files=$(curl -L ${{ github.event.pull_request.diff_url }} | grep -e "^diff --git a/" | sed -e "s#diff --git a/##g")
changed_files=echo "$changed_files" | tr '\n' ':'
echo "-----"
echo $changed_files
echo "-----"
echo changed_files=$changed_files >> $GITHUB_OUTPUT
bin/files_changed_from_diff.sh ${{ steps.extract_pid.outputs.project_id }}
- name: "get changed files from diff extract"
continue-on-error: true
id: diffs
env:
CHANGED_FILES: ${{ steps.diff_files.outputs.changed_files }}
run: |
CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ' ' ':')
echo "###$CHANGED_FILES###"
bin/files_changed_from_diff.sh ${{ steps.extract_pid.outputs.project_id }}
- name: "validation"
continue-on-error: true
run: |
OK="${{ steps.diffs.outputs.files_ok }}"
bin/validate.sh $OK
- name: "report error"
run: |
OK="${{ steps.diffs.outputs.files_ok }}"
NOK="${{ steps.diffs.outputs.files_not_ok }}"
bin/report.sh $OK $NOK