Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix i18n-custom-nodes action #1991

Merged
merged 27 commits into from
Dec 31, 2024
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
aac1507
Fix git username
huchenlei Dec 19, 2024
249f03b
Auth with GH token
huchenlei Dec 19, 2024
1b287d8
nit
huchenlei Dec 19, 2024
652ae37
Use gh repo sync
huchenlei Dec 19, 2024
e1a9a9f
nit
huchenlei Dec 19, 2024
ced8566
nit
huchenlei Dec 19, 2024
d1b8996
nit
huchenlei Dec 19, 2024
8303d66
nit
huchenlei Dec 19, 2024
57b0c7b
nit
huchenlei Dec 19, 2024
2649702
gh_token_pr
snomiao Dec 20, 2024
8a40855
chore(i18n): use gh-token-pr env
snomiao Dec 30, 2024
b311afd
Merge github.com:Comfy-Org/ComfyUI_frontend into fix_custom_translations
snomiao Dec 30, 2024
995be59
chore(fix_custom_translations): i18n pr origin
snomiao Dec 30, 2024
8db23f1
chore(workflows): try remove x-access-token
snomiao Dec 30, 2024
d9f6569
chore(workflows): fix workflow
snomiao Dec 30, 2024
af7e6d7
chore(workflow): try push directly to url
snomiao Dec 30, 2024
fc3dfe7
fix(fix_custom_translations): permissions
snomiao Dec 30, 2024
4426811
fix(fix_custom_translations): pat prefix
snomiao Dec 30, 2024
42b66ef
fix(fix_custom_translations): only rename pr
snomiao Dec 30, 2024
292faf9
fix(fix_custom_translations): use app token
snomiao Dec 30, 2024
650675e
fix(fix_custom_translations): push by sshkey
snomiao Dec 31, 2024
ea0a1fa
fix(workflows): skip app token
snomiao Dec 31, 2024
1ff5adf
fix(fix_custom_translations): try fork_owner
snomiao Dec 31, 2024
76e463d
fix(fix_custom_translations): remove test workflow
snomiao Dec 31, 2024
e5b58a5
fix(workflows): add body draft
snomiao Dec 31, 2024
0e77d19
Merge remote-tracking branch 'origin/main' into fix_custom_translations
snomiao Dec 31, 2024
a2c0a7d
nit
huchenlei Dec 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions .github/workflows/i18n-custom-nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,56 @@ jobs:
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
- name: Check and create fork of custom node repository
run: |
# Try to fork the repository
gh repo fork ${{ inputs.owner }}/${{ inputs.repository }} --clone=false || {
echo "Fork failed - repository might already be forked"
# Exit 0 to prevent the workflow from failing
exit 0
}

# Enable workflows on the forked repository
gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
"/repos/${{ inputs.fork_owner }}/${{ inputs.repository }}/actions/permissions/workflow" \
-F can_approve_pull_request_reviews=true \
-F default_workflow_permissions="write" \
-F enabled=true
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Commit and push changes
GH_TOKEN: ${{ secrets.PR_GH_TOKEN }}

- name: Commit changes
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'

# Create and switch to new branch
git checkout -b update-locales

# Stage and commit changes
git add -A
git commit -m "Update locales"
git remote add org_fork [email protected]:${{ inputs.fork_owner }}/${{ inputs.repository }}.git
git push org_fork update-locales
gh pr create --title "Update locales for ${{ inputs.repository }}" --repo ${{ inputs.owner }}/${{ inputs.repository }} --head ${{ inputs.fork_owner }}:update-locales

- name: Install SSH key For PUSH
uses: shimataro/ssh-key-action@v2
with:
# PR private key from action server
key: ${{ secrets.PR_SSH_PRIVATE_KEY }}
# github public key to confirm it's github server
known_hosts: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==

- name: Push changes
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: |
# Force push to create the branch
echo "Pushing changes to ${{ inputs.fork_owner }}/${{ inputs.repository }}"
git push -f [email protected]:${{ inputs.fork_owner }}/${{ inputs.repository }}.git update-locales

- name: Create PR
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: |
# Create PR using gh cli
gh pr create --title "Update locales for ${{ inputs.repository }}" --repo ${{ inputs.owner }}/${{ inputs.repository }} --head ${{ inputs.fork_owner }}:update-locales --body "Update locales for ${{ inputs.repository }}"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.PR_GH_TOKEN }}
Loading