[PATCH v5 0/1] ci: new github-action for git-l10n code review

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jiang Xin <zhiyou.jx@xxxxxxxxxxxxxxx>

## Changes since v4

* "git-po-helper check-commits" can work with bare repository now. So do not use
  "actions/checkout@v2" to prepare workspace any more.

* "git-po-helper learned how to fetch missing blobs in a batch. So do a blobless
  partial clone.


## range-diff v4...v5

1:  0067ccc ! 1:  1c43d6b ci: new github-action for git-l10n code review
    @@ .github/workflows/l10n.yml (new)
     +    permissions:
     +      pull-requests: write
     +    steps:
    -+      - uses: actions/checkout@v2
    -+        with:
    -+          fetch-depth: '1'
    -+      - name: Fetch missing commits
    -+        id: fetch-commits
    ++      - name: Setup base and head objects
    ++        id: setup-tips
     +        run: |
     +          if test "${{ github.event_name }}" = "pull_request_target"
     +          then
    @@ .github/workflows/l10n.yml (new)
     +            base=${{ github.event.before }}
     +            head=${{ github.event.after }}
     +          fi
    ++          echo "::set-output name=base::$base"
    ++          echo "::set-output name=head::$head"
    ++      - name: Run partial clone
    ++        run: |
    ++          git -c init.defaultBranch=master init --bare .
    ++          git remote add \
    ++            --mirror=fetch \
    ++            origin \
    ++            https://github.com/${{ github.repository }}
    ++          # Fetch tips that may be unreachable from github.ref:
    ++          # - For a forced push, "$base" may be unreachable.
    ++          # - For a "pull_request_target" event, "$head" may be unreachable.
     +          args=
    -+          for commit in $base $head
    ++          for commit in \
    ++            ${{ steps.setup-tips.outputs.base }} \
    ++            ${{ steps.setup-tips.outputs.head }}
     +          do
     +            case $commit in
     +            *[^0]*)
     +              args="$args $commit"
     +              ;;
     +            *)
    -+              # Ignore ZERO-OID.
    ++              # Should not fetch ZERO-OID.
     +              ;;
     +            esac
     +          done
    -+          # Unshallow the repository, and fetch missing commits using partial
    -+          # clone.  "$base" may be missing due to forced push, and "$head"
    -+          # may be missing due to the "pull_request_target" event.
    -+          git fetch --unshallow --filter=blob:none origin $args
    -+          echo "::set-output name=base::$base"
    -+          echo "::set-output name=head::$head"
    ++          git -c protocol.version=2 fetch \
    ++            --progress \
    ++            --no-tags \
    ++            --no-write-fetch-head \
    ++            --filter=blob:none \
    ++            origin \
    ++            ${{ github.ref }} \
    ++            $args
     +      - uses: actions/setup-go@v2
     +        with:
     +          go-version: '>=1.16'
    @@ .github/workflows/l10n.yml (new)
     +        run: |
     +          exit_code=0
     +          git-po-helper check-commits \
    -+              --github-action-event="${{ github.event_name }}" -- \
    -+              ${{ steps.fetch-commits.outputs.base }}..${{ steps.fetch-commits.outputs.head }} \
    -+              >git-po-helper.out 2>&1 ||
    -+            exit_code=$?
    ++            --github-action-event="${{ github.event_name }}" -- \
    ++            ${{ steps.setup-tips.outputs.base }}..${{ steps.setup-tips.outputs.head }} \
    ++            >git-po-helper.out 2>&1 || exit_code=$?
     +          if test $exit_code -ne 0 || grep -q WARNING git-po-helper.out
     +          then
     +            # Remove ANSI colors which are proper for console logs but not

----

Jiang Xin (1):
  ci: new github-action for git-l10n code review

 .github/workflows/l10n.yml | 105 +++++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 .github/workflows/l10n.yml

-- 
2.33.0




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux