Skip to content

Commit 9f5171b

Browse files
committed
fix issue push on main
1 parent 4c1b865 commit 9f5171b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/permissions.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# .github/permissions.yml
2+
permissions:
3+
contents: write
4+
pull-requests: write
5+
issues: write
6+
checks: write
7+
statuses: write

.github/workflows/onPushToMain.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ jobs:
3737
- name: Generate oclif README
3838
if: ${{ steps.version-check.outputs.skipped == 'false' }}
3939
id: oclif-readme
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4042
run: |
4143
npm install
4244
npm exec oclif readme
4345
if [ -n "$(git status --porcelain)" ]; then
4446
git add .
4547
git commit -am "chore: update README.md"
46-
git push -u origin ${{ github.ref_name }}
48+
git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/${{ github.repository }}.git
49+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
50+
git config --global user.name "${{ github.actor }}"
51+
git pull --rebase
52+
git push origin ${{ github.ref_name }}
4753
fi
4854
- name: Create Github Release
4955
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5

0 commit comments

Comments
 (0)