Skip to content

Commit

Permalink
chore: fix login and approve
Browse files Browse the repository at this point in the history
  • Loading branch information
tianzhou committed Mar 4, 2024
1 parent b61a746 commit d539748
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/actions/login/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ function run() {
});
const loginResData = yield loginRes.json();
if (!loginResData.token) {
throw new Error("Failed to generate token for user: " + service_account + ". Please check the service account and key.");
throw new Error("Failed to obtain token for user: " + service_account + ". Please check the service account and key.");
}
return loginResData.token;
core.info("Login successful for user: " + service_account + ". Token obtained.");
core.setOutput('token', loginResData.token);
});
}
run();
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ async function run(): Promise<void> {
});
const loginResData = await loginRes.json();
if (!loginResData.token) {
throw new Error("Failed to generate token for user: " + service_account + ". Please check the service account and key.");
throw new Error("Failed to obtain token for user: " + service_account + ". Please check the service account and key.");
}

return loginResData.token;

core.info("Login successful for user: " + service_account + ". Token obtained.")
core.setOutput('token', loginResData.token);
}

run();
3 changes: 2 additions & 1 deletion .github/workflows/approve-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
service_account: ${{ env.SERVICE_ACCOUNT }}
service_account_key: ${{ secrets.BYTEBASE_PASSWORD }}
- name: Approve issue
id: approve
uses: ./.github/actions/approve
with:
endpoint: ${{ env.API_ENDPOINT }}
token: ${{steps.login.outputs.token}}
token: ${{ steps.login.outputs.token }}
issue_id: 114
comment: "Approved by CI"

0 comments on commit d539748

Please sign in to comment.