Skip to content

Commit 7122e56

Browse files
📄 patch the action error
1 parent eddf87c commit 7122e56

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/onPushToMain.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# test
21
name: version, tag and github release
32

43
on:
@@ -10,15 +9,16 @@ jobs:
109
runs-on: ubuntu-latest
1110
steps:
1211
- uses: actions/checkout@v4
12+
1313
- uses: actions/setup-node@v4
14+
1415
- name: Check if version already exists
1516
id: version-check
1617
run: |
1718
package_version=$(node -p "require('./package.json').version")
1819
exists=$(gh api repos/${{ github.repository }}/releases/tags/v$package_version >/dev/null 2>&1 && echo "true" || echo "")
1920
20-
if [ -n "$exists" ];
21-
then
21+
if [ -n "$exists" ]; then
2222
echo "Version v$package_version already exists"
2323
echo "::warning file=package.json,line=1::Version v$package_version already exists - no release will be created. If you want to create a new release, please update the version in package.json and push again."
2424
echo "skipped=true" >> $GITHUB_OUTPUT
@@ -29,11 +29,19 @@ jobs:
2929
fi
3030
env:
3131
GH_TOKEN: ${{ secrets.GH_TOKEN }}
32+
33+
- name: Debug Git Config Secrets (optional)
34+
if: ${{ steps.version-check.outputs.skipped == 'false' }}
35+
run: |
36+
echo "GH_EMAIL is set: ${{ secrets.GH_EMAIL != '' }}"
37+
echo "GH_USERNAME is set: ${{ secrets.GH_USERNAME != '' }}"
38+
3239
- name: Setup git
3340
if: ${{ steps.version-check.outputs.skipped == 'false' }}
3441
run: |
35-
git config --global user.email ${{ secrets.GH_EMAIL }}
36-
git config --global user.name ${{ secrets.GH_USERNAME }}
42+
git config --global user.email "${{ secrets.GH_EMAIL || 'default@example.com' }}"
43+
git config --global user.name "${{ secrets.GH_USERNAME || 'github-actions[bot]' }}"
44+
3745
- name: Generate oclif README
3846
if: ${{ steps.version-check.outputs.skipped == 'false' }}
3947
id: oclif-readme
@@ -45,6 +53,7 @@ jobs:
4553
git commit -am "chore: update README.md"
4654
git push -u origin ${{ github.ref_name }}
4755
fi
56+
4857
- name: Create Github Release
4958
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
5059
if: ${{ steps.version-check.outputs.skipped == 'false' }}

0 commit comments

Comments
 (0)