git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 2915c595b4f195559dbcb0ad121b1bf5c9373cfe 3673 bytes (raw)
name: .github/workflows/l10n.yml 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
 
name: git-l10n

on: [push, pull_request_target]

jobs:
  git-po-helper:
    if: >-
      endsWith(github.repository, '/git-po') ||
      contains(github.head_ref, 'l10n') ||
      contains(github.ref, 'l10n')
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - name: Setup base and head objects
        id: setup-tips
        run: |
          if test "${{ github.event_name }}" = "pull_request_target"
          then
            base=${{ github.event.pull_request.base.sha }}
            head=${{ github.event.pull_request.head.sha }}
          else
            base=${{ github.event.before }}
            head=${{ github.event.after }}
          fi
          echo "base=$base" >>$GITHUB_OUTPUT
          echo "head=$head" >>$GITHUB_OUTPUT
      - 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 \
            ${{ steps.setup-tips.outputs.base }} \
            ${{ steps.setup-tips.outputs.head }}
          do
            case $commit in
            *[^0]*)
              args="$args $commit"
              ;;
            *)
              # Should not fetch ZERO-OID.
              ;;
            esac
          done
          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'
      - name: Install git-po-helper
        run: go install github.com/git-l10n/git-po-helper@main
      - name: Install other dependencies
        run: |
          sudo apt-get update -q &&
          sudo apt-get install -q -y gettext
      - name: Run git-po-helper
        id: check-commits
        run: |
          exit_code=0
          git-po-helper check-commits \
            --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
            # proper for PR comment.
            echo "COMMENT_BODY<<EOF" >>$GITHUB_ENV
            perl -pe 's/\e\[[0-9;]*m//g; s/\bEOF$//g' git-po-helper.out >>$GITHUB_ENV
            echo "EOF" >>$GITHUB_ENV
          fi
          cat git-po-helper.out
          exit $exit_code
      - name: Create comment in pull request for report
        uses: mshick/add-pr-comment@v1
        if: >-
          always() &&
          github.event_name == 'pull_request_target' &&
          env.COMMENT_BODY != ''
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          repo-token-user-login: 'github-actions[bot]'
          message: >
            ${{ steps.check-commits.outcome == 'failure' && 'Errors and warnings' || 'Warnings' }}
            found by [git-po-helper](https://github.com/git-l10n/git-po-helper#readme) in workflow
            [#${{ github.run_number }}](${{ env.GITHUB_SERVER_URL }}/${{ github.repository }}/actions/runs/${{ github.run_id }}):

            ```

            ${{ env.COMMENT_BODY }}

            ```

debug log:

solving 2915c595b4f ...
found 2915c595b4f in https://public-inbox.org/git/patch-v3-1.1-0519cc1105a-20221208T003233Z-avarab@gmail.com/ ||
	https://public-inbox.org/git/1081c62fb266bc41f7084ea2a974729315a7634a.1670423680.git.gitgitgadget@gmail.com/
found 27f72f0ff34 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 27f72f0ff34482912ee894570ff277e43d5d3ddf	.github/workflows/l10n.yml

applying [1/1] https://public-inbox.org/git/patch-v3-1.1-0519cc1105a-20221208T003233Z-avarab@gmail.com/
diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml
index 27f72f0ff34..2915c595b4f 100644

Checking patch .github/workflows/l10n.yml...
Applied patch .github/workflows/l10n.yml cleanly.

skipping https://public-inbox.org/git/1081c62fb266bc41f7084ea2a974729315a7634a.1670423680.git.gitgitgadget@gmail.com/ for 2915c595b4f
index at:
100644 2915c595b4f195559dbcb0ad121b1bf5c9373cfe	.github/workflows/l10n.yml

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).