Skip to content

Commit

Permalink
test 4
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyangliu committed Jul 12, 2024
1 parent fe87e1c commit a7ab243
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/sync_release_to_gitee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,27 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch');
const response = await fetch('https://gitee.com/api/v5/repos/openblockcc/external-resources-v3/releases', {
method: 'POST',
headers: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + ${{ secrets.GITEE_TOKEN }}
},
body: JSON.stringify({
access_token: '${{ secrets.GITEE_TOKEN }}',
'Authorization': `Bearer ${process.env.GITEE_TOKEN}`
},
body: JSON.stringify({
access_token: '${{ secrets.GITEE_TOKEN }}',
tag_name: '${{ steps.get_release_info.outputs.tag_name }}',
name: '${{ steps.get_release_info.outputs.name }}',
body: '${{ steps.get_release_info.outputs.body }}',
draft: false,
prerelease: true
})
prerelease: false,
target_commitish: 'main'
})
});
if (!response.ok) {
const error = await response.json();
core.setFailed(`Error creating Gitee release: ${error.message}`);
const error = await response.json();
core.setFailed(`Error creating Gitee release: ${error.message}`);
} else {
const data = await response.json();
console.log('Gitee release created successfully:', data);
const data = await response.json();
console.log('Gitee release created successfully:', data);
}

0 comments on commit a7ab243

Please sign in to comment.