mirror of
https://github.com/ditkrg/project-version-check.git
synced 2026-01-22 22:06:42 +00:00
Append newline to the end of the file
Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com>
This commit is contained in:
parent
3829330c4e
commit
0b2fb2a01e
9
index.js
9
index.js
@ -61,9 +61,12 @@ async function run() {
|
|||||||
// Region functions
|
// Region functions
|
||||||
async function commitChanges(file, filePath) {
|
async function commitChanges(file, filePath) {
|
||||||
const commitMessage = 'Commit message here';
|
const commitMessage = 'Commit message here';
|
||||||
const newContent = file;
|
|
||||||
const githubToken = core.getInput('githubToken');
|
|
||||||
|
|
||||||
|
let newContent = JSON.stringify(newContent, null, 2);
|
||||||
|
// Append a newline character to the end of the new content
|
||||||
|
newContent += '\n';
|
||||||
|
|
||||||
|
const githubToken = core.getInput('githubToken');
|
||||||
|
|
||||||
// Get the repository owner and name
|
// Get the repository owner and name
|
||||||
const repoFullName = process.env.GITHUB_REPOSITORY;
|
const repoFullName = process.env.GITHUB_REPOSITORY;
|
||||||
@ -84,7 +87,7 @@ async function commitChanges(file, filePath) {
|
|||||||
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`,
|
||||||
{
|
{
|
||||||
content: JSON.stringify(newContent, null, 2),
|
content: newContent,
|
||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user