ci: add auto-merge after crowdin download and automatic approval (#1632)
This commit is contained in:
@@ -4,9 +4,9 @@ on:
|
|||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
approve-renovate-prs:
|
approve-automatic-prs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.actor_id == 158783068 # Id of renovate bot see https://api.github.com/users/homarr-renovate%5Bbot%5D
|
if: github.actor_id == 158783068 || github.actor_id == 190541745 # Id of renovate bot and crowdin bot see https://api.github.com/users/homarr-renovate%5Bbot%5D and https://api.github.com/users/homarr-crowdin%5Bbot%5D
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
app_id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
app_id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
||||||
- name: Install GitHub CLI
|
- name: Install GitHub CLI
|
||||||
run: sudo apt-get install -y gh
|
run: sudo apt-get install -y gh
|
||||||
- name: Approve Renovate PRs
|
- name: Approve automatic PRs
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
@@ -21,6 +21,7 @@ jobs:
|
|||||||
app_id: ${{ secrets.CROWDIN_APP_ID }}
|
app_id: ${{ secrets.CROWDIN_APP_ID }}
|
||||||
|
|
||||||
- name: Download Crowdin translations
|
- name: Download Crowdin translations
|
||||||
|
id: crowdin-download
|
||||||
uses: crowdin/github-action@v2
|
uses: crowdin/github-action@v2
|
||||||
with:
|
with:
|
||||||
upload_sources: false
|
upload_sources: false
|
||||||
@@ -30,6 +31,7 @@ jobs:
|
|||||||
create_pull_request: true
|
create_pull_request: true
|
||||||
pull_request_title: "chore(lang): updated translations from crowdin"
|
pull_request_title: "chore(lang): updated translations from crowdin"
|
||||||
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)"
|
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)"
|
||||||
|
commit_message: "chore(lang): update translations from crowdin"
|
||||||
pull_request_base_branch_name: "dev"
|
pull_request_base_branch_name: "dev"
|
||||||
github_user_name: "Crowdin Homarr"
|
github_user_name: "Crowdin Homarr"
|
||||||
github_user_email: "190541745+homarr-crowdin[bot]@users.noreply.github.com"
|
github_user_email: "190541745+homarr-crowdin[bot]@users.noreply.github.com"
|
||||||
@@ -38,3 +40,9 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||||
|
|
||||||
|
- name: Enable auto-merge
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
||||||
|
run: |
|
||||||
|
gh pr merge ${{steps.crowdin-download.pull_request_number}} --auto --merge --squash --delete-branch --title "chore(lang): updated translations from crowdin"
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
files:
|
files:
|
||||||
- source: /packages/translation/src/lang/en.json
|
- source: /packages/translation/src/lang/en.json
|
||||||
translation: /packages/translation/src/lang/%two_letters_code%.json
|
translation: /packages/translation/src/lang/%two_letters_code%.json
|
||||||
|
|
||||||
# Title of pull request and so the commit that will be used for squashed merge commit
|
|
||||||
pull_request_title: "chore(lang): updated translations from crowdin"
|
|
||||||
|
|
||||||
# Custom commit message that is not only appended
|
|
||||||
commit_message: "chore(lang): update translations %original_file_name% from crowdin [skip ci]"
|
|
||||||
append_commit_message: false
|
|
||||||
Reference in New Issue
Block a user