Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
revert: use workflow dispatch to push token to GitHub repo instead
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Jul 24, 2024
1 parent fb97e08 commit f9a8c34
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions sources/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import * as GitHub from '@octokit/rest'

export async function PushTokenToRepo(Repo: string, Token: string, SHA: string, GitHubToken: string) {
const GitHubInstance = new GitHub.Octokit({ auth: GitHubToken })
const Result = await GitHubInstance.actions.createWorkflowDispatch({
await GitHubInstance.repos.createOrUpdateFileContents({
owner: Repo.split('/')[0],
repo: Repo.split('/')[1],
workflow_id: '.github/workflows/commit.yml',
ref: 'main',
inputs: {
token: Token,
sha: SHA
}
path: SHA,
message: `Update for ${SHA}`,
content: btoa(Token)
})
console.log(SHA, Result.status)
}

0 comments on commit f9a8c34

Please sign in to comment.