Skip to content

Commit

Permalink
ci: add automatic kbrp synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoheml committed Aug 16, 2024
1 parent d8c2103 commit fa3fc44
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/language-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,42 @@ jobs:
user_name: github-actions
commit_message: Synchronize language from public repository
destination_branch: develop
kbrpPush:
needs: [ setup ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
value: ${{fromJson(needs.setup.outputs.matrix)}}
steps:
-
name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
-
name: Extract folder name of the path
id: folder-name
run: |
echo "REPOSITORY=$(echo "${{ matrix.value }}" | cut -d'/' -f 1)" >> $GITHUB_ENV
echo "TARGET_FOLDER=$(echo "${{ matrix.value }}" | cut -d'/' -f 2- | rev | cut -d '/' -f 2- | rev)" >> $GITHUB_ENV
-
name: Check if the env.REPOSITORY exists in the KB-RolePlay organization
id: check-repo
run: |
curl -s -H "Authorization: token ${{ secrets.PAT }}" https://api.github.com/orgs/KB-RolePlay/repos | jq -r '.[].name' | grep -q ${{ env.REPOSITORY }}
echo "REPOSITORY_EXISTS=$?" >> $GITHUB_ENV
-
name: Push file
uses: dmnemec/[email protected]
if: steps.check-repo.outputs.REPOSITORY_EXISTS == 0
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source_file: ${{ matrix.value }}
destination_repo: KB-RolePlay/${{ env.REPOSITORY }}
destination_folder: lua/${{ env.TARGET_FOLDER }}
user_email: [email protected]
user_name: github-actions
commit_message: Synchronize language from public KB-GModStore repository
destination_branch: main
2 changes: 1 addition & 1 deletion zeros_yeastbeast/zyb_languages/sh_zyb_language_fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ if (zyb.config.SelectedLanguage == "fr") then
zyb.language.VGUI["Installed"] = "Installé"
zyb.language.VGUI["Buy"] = "Acheté"
zyb.language.VGUI["Sell"] = "Vendre"
end
end

0 comments on commit fa3fc44

Please sign in to comment.