PR to test failure in added pictures #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
fetch-depth: 1 | |
submodules: false | |
- name: "checkout pr base and head" | |
run: | | |
git fetch --no-tags --depth=1 origin main | |
git checkout main | |
echo "about to checkout pr base" | |
git fetch origin ${{ github.event.pull_request.base.sha }} | |
git checkout -b pr_base ${{ github.event.pull_request.base.sha }} | |
echo "about to checkout head" | |
git fetch origin ${{ github.event.pull_request.head.sha }} | |
git checkout -b pr_head ${{ github.event.pull_request.head.sha }} | |
- name: "curl1" | |
continue-on-error: true | |
run: | | |
curl https://patch-diff.githubusercontent.com/raw/htw-imi-showtime/showtime-website/pull/350.diff 2> /dev/null | grep -e "diff --git" | sed -e "s#diff --git a/##g" | |
- name: "curl2" | |
continue-on-error: true | |
run: | | |
diff_file=${{ github.event.pull_request.diff_url }} | |
echo $diff_file | |
curl $diff_file 2> /dev/null | grep -e "diff --git" | sed -e "s#diff --git a/##g" | |
- name: "merge-base" | |
if: true | |
run: | | |
git status | |
echo "------ git log --------" | |
git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow )%d%C(reset)' --all | |
echo "----- git merge-base pr_head pr_base -----" | |
# git merge-base pr_head pr_base | |
- 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: "get changed files from git diff" | |
continue-on-error: true | |
id: diffs | |
run: | | |
bin/files_changed.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 |