Skip to content

Commit

Permalink
test 3
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyangliu committed Jul 12, 2024
1 parent 2012ce6 commit fe87e1c
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/sync_release_to_gitee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,26 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const axios = require('axios');
const releaseData = {
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: false
};
const response = await fetch('https://gitee.com/api/v5/repos/openblockcc/external-resources-v3/releases', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + ${{ secrets.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
})
});
axios.post('https://gitee.com/api/v5/repos/openblockcc/external-resources-v3/releases', releaseData)
.then(response => {
console.log('Gitee release created successfully:', response.data);
})
.catch(error => {
console.error('Error creating Gitee release:', error);
core.setFailed(error.message);
});
if (!response.ok) {
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);
}

0 comments on commit fe87e1c

Please sign in to comment.