Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add await for async function call #19

Merged
merged 4 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ The (base) branch where the PR will be created against at. Default is main.
## Release

1. Checkout the repo (`git clone ...`)
2. Run `npm install`
3. Run `ncc build index.js` (`ncc` required to be installed: `npm i -g @vercel/ncc`)
4. Push to the repo
2. Install `npm`
3. Run `npm install`
4. Run `npm run build`
5. Push to the repo

## Developer information links

Expand Down
6 changes: 3 additions & 3 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function run() {
core.info('Try to update the "go.mod" file with Go version ' + latestGoVersion);
updateGoVersion(latestGoVersion)

const changes = detectGitChanges()
const changes = await detectGitChanges()
if (!changes) {
core.info('No changes detect.\nSeems everything is up to date 🎉');
return
Expand Down Expand Up @@ -61,15 +61,15 @@ async function updateGoVersion(goVersion) {
}

async function detectGitChanges() {
let gitChanges;
let gitChanges = '';
const execOptionsGitChanges = {};
execOptionsGitChanges.listeners = {
stdout: (data) => {
gitChanges += data.toString();
},
};
await exec.exec('git status -s', '', execOptionsGitChanges);
return gitChanges != undefined || gitChanges != ""
return gitChanges !== ''
}

async function branchWithNameAlreadyExist(githubToken, branchName, repoOwner, repoName) {
Expand Down
Loading
Loading