1- # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
1+ # This workflow is provided via the organization template repository
2+ #
3+ # https://github.com/nextcloud-libraries/.github
4+ # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+ #
6+ # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
27# SPDX-License-Identifier: MIT
38
49name : Command L10n Update
510on :
611 issue_comment :
712 types : [created]
13+ permissions :
14+ contents : read
815
916jobs :
1017 init :
@@ -19,62 +26,44 @@ jobs:
1926
2027 steps :
2128 - name : Add reaction on start
22- uses : peter-evans/create-or-update-comment@v4
29+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
2330 with :
2431 token : ${{ secrets.COMMAND_BOT_PAT }}
2532 repository : ${{ github.event.repository.full_name }}
2633 comment-id : ${{ github.event.comment.id }}
2734 reaction-type : " +1"
2835
2936 - name : Parse command
30- uses : skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1
37+ uses : skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1.0
3138 id : command
3239
3340 - name : Init branch
3441 uses : xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
3542 id : comment-branch
3643
37- - name : Add reaction on failure
38- uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
39- if : failure()
40- with :
41- token : ${{ secrets.COMMAND_BOT_PAT }}
42- repository : ${{ github.event.repository.full_name }}
43- comment-id : ${{ github.event.comment.id }}
44- reactions : ' -1'
45-
4644 process :
4745 runs-on : ubuntu-latest
4846 needs : init
4947
5048 steps :
5149 - name : Checkout ${{ needs.init.outputs.head_ref }}
52- uses : actions/checkout@v4
50+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5351 with :
54- token : ${{ secrets.COMMAND_BOT_PAT }}
5552 fetch-depth : 0
5653 ref : ${{ needs.init.outputs.head_ref }}
54+ # Needed to push changes
55+ persist-credentials : true
56+ token : ${{ secrets.COMMAND_BOT_PAT }}
5757
5858 - name : Setup git
5959 run : |
6060 git config --local user.email "nextcloud-command@users.noreply.github.com"
6161 git config --local user.name "nextcloud-command"
6262
63- - name : Read package.json node and npm engines version
64- uses : skjnldsv/read-package-engines-version-actions@v3
65- id : package-engines-versions
63+ - name : Set up node
64+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6665 with :
67- fallbackNode : ' ^20'
68- fallbackNpm : ' ^10'
69-
70- - name : Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
71- uses : actions/setup-node@v4
72- with :
73- node-version : ${{ steps.package-engines-versions.outputs.nodeVersion }}
74- cache : npm
75-
76- - name : Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
77- run : npm i -g npm@"${{ steps.package-engines-versions.outputs.npmVersion }}"
66+ node-version-file : package.json
7867
7968 - name : Install dependencies & build l10n
8069 run : |
8574 if : ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }}
8675 run : |
8776 git add .
88- git commit --signoff -m 'Updating l10n asset '
77+ git commit --signoff -m 'chore( l10n): extract new translations '
8978 git push origin ${{ needs.init.outputs.head_ref }}
9079
9180 - name : Commit and push fixup
10392 git push --force origin ${{ needs.init.outputs.head_ref }}
10493
10594 - name : Add reaction on failure
106- uses : peter-evans/create-or-update-comment@v4
95+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
10796 if : failure()
10897 with :
10998 token : ${{ secrets.COMMAND_BOT_PAT }}
0 commit comments