diff --git a/.github/actions/check-todo/check.sh b/.github/actions/check-todo/check.sh index ebd48a231..c3c67fc85 100755 --- a/.github/actions/check-todo/check.sh +++ b/.github/actions/check-todo/check.sh @@ -15,11 +15,20 @@ if [ $# -gt 0 ]; then shift fi -git diff --name-only "$BASE_REF...$BRANCH_REF" | grep -E '[.](php|phpt|vue|js)$' | while read line +echo "Base Reference: $BASE_REF" +echo "Head Reference: $BRANCH_REF" + +files="$(git diff --name-only "$BASE_REF...$BRANCH_REF")" + +echo '::group::Updated files' +echo "$files" +echo '::endgroup::' + +echo "$files" | grep -E '[.](php|phpt|vue|js)$' | while read line do file=$(echo "$line" | sed 's@^\./@@') - grep -noE '(TODO|ToDo|@todo|XXX|FIXME|FixMe)([^a-zA-Z].*)?$' "$line" | while read match + grep -noE '(TODO|ToDo|@todo|XXX|FIXME|FixMe)([^a-zA-Z0-9].*)?$' "$line" | while read match do IFS=: read lineno msg <<< "$match" echo "::warning file=$file,line=$lineno::Found $msg" diff --git a/.github/workflows/pull-checks.yml b/.github/workflows/pull-checks.yml index e6034afa0..c1acfeb28 100644 --- a/.github/workflows/pull-checks.yml +++ b/.github/workflows/pull-checks.yml @@ -43,15 +43,24 @@ jobs: name: Check for added todo messages runs-on: ubuntu-latest steps: - - name: Manual checkout of the app + - name: Git version output + run: git version + - name: Manual checkout of the app (base repo) run: | REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" BRANCH="${GITHUB_REF/#refs\/heads\//}" - git version - git clone --filter=tree:0 "$REPO" . - git checkout ${{ github.head_ref }} + - name: Manual checkout of the app (PR head) + run: | + git remote add head "${{ github.event.pull_request.head.repo.html_url }}" + git fetch head --filter=tree:0 + + git checkout -b head-branch head/${{ github.head_ref }} + - name: Status of current git workspace + run: | + git branch + git status - name: Check for open TODO annotations in source code uses: ./.github/actions/check-todo diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cfec09e6..074222837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ - Update eslint-plugin-vue - Fix refresh-icon overlays name of recipe [#1033](https://github.com/nextcloud/cookbook/pull/1033) @MarcelRobitaille +- Reenable PR checks from foreign forks + [#1045](https://github.com/nextcloud/cookbook/pull/1045) @christianlupus ### Codebase maintenance - Removed codecov.io upload of intermediate merge commits during pull requests [#1028](https://github.com/nextcloud/cookbook/issues/1028)