Skip to content

Commit

Permalink
ci: fixed error for create pull requests with CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
FajarKim committed Dec 7, 2023
1 parent 364ea38 commit 1a62a49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/generate-locale-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,19 @@ jobs:
- name: Push commit to a new branch
run: |
branch="auto_update_locale_readme"
message="docs(translation): auto update translation readme"
if [[ "$(git status --porcelain)" != "" ]]; then
git branch -D auto-update-locale-readme || true
git checkout -b auto-update-locale-readme
git branch -D ${branch} || true
git checkout -b ${branch}
git add docs/translations.md
git commit --message "${message}"
git remote add origin-auto-update-locale-readme "https://github.com/FajarKim/github-readme-profile.git"
git push --force --quiet --set-upstream origin-auto-update-locale-readme auto-update-locale-readme
git remote add origin-${branch} "https://github.com/FajarKim/github-readme-profile.git"
git push --force --quiet --set-upstream origin-${branch} ${branch}
fi
- name: Create Pull Request
run: |
gh pr create --title "${message}" --body ""
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 7 additions & 4 deletions .github/workflows/generate-theme-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,19 @@ jobs:
- name: Push commit to a new branch
run: |
branch="auto_update_theme_readme"
message="docs(theme): auto update theme readme"
if [[ "$(git status --porcelain)" != "" ]]; then
git branch -D auto-update-theme-readme || true
git checkout -b auto-update-theme-readme
git branch -D ${branch} || true
git checkout -b ${branch}
git add themes/README.md
git commit --message "${message}"
git remote add origin-auto-update-theme-readme "https://github.com/FajarKim/github-readme-profile.git"
git push --force --quiet --set-upstream origin-auto-update-theme-readme auto-update-theme-readme
git remote add origin-${branch} "https://github.com/FajarKim/github-readme-profile.git"
git push --force --quiet --set-upstream origin-${branch} ${branch}
fi
- name: Create Pull Request
run: |
gh pr create --title "${message}" --body ""
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1a62a49

Please sign in to comment.