Add more logs

Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com>
This commit is contained in:
Shakar 2023-09-19 11:19:45 +03:00
parent ae2dbd7484
commit 556815239c
No known key found for this signature in database
GPG Key ID: DA55A26823AE3C28

View File

@ -82,7 +82,7 @@ async function commitChanges(filePath, file) {
); );
const baseTreeSha = branchResponse.data.commit.sha; const baseTreeSha = branchResponse.data.commit.sha;
console.log(file) console.log(typeof file, file)
// Create a new blob with the updated content // Create a new blob with the updated content
const blobResponse = await axios.post( const blobResponse = await axios.post(
`https://api.github.com/repos/${owner}/${repo}/git/blobs`, `https://api.github.com/repos/${owner}/${repo}/git/blobs`,
@ -98,6 +98,7 @@ async function commitChanges(filePath, file) {
} }
); );
console.log('Blob Created')
const newBlobSha = blobResponse.data.sha; const newBlobSha = blobResponse.data.sha;
// Create a new tree with the updated blob // Create a new tree with the updated blob
const treeResponse = await axios.post( const treeResponse = await axios.post(
@ -121,6 +122,7 @@ async function commitChanges(filePath, file) {
} }
); );
console.log('Tree Created')
const newTreeSha = treeResponse.data.sha; const newTreeSha = treeResponse.data.sha;
// Create a new commit // Create a new commit
@ -139,6 +141,7 @@ async function commitChanges(filePath, file) {
} }
); );
console.log('Commit Created')
const newCommitSha = commitResponse.data.sha; const newCommitSha = commitResponse.data.sha;
// Update the branch reference // Update the branch reference
@ -154,6 +157,7 @@ async function commitChanges(filePath, file) {
}, },
} }
); );
console.log('Branch Updated')
} catch (error) { } catch (error) {
core.setFailed(error); core.setFailed(error);