-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(github-actions): use GitHub PAT instead of GitHub App key in `cre…
…ate-pr-for-changes` Using the GitHub App key for Angular Robot does not retrieving a fork to create PRs from. Switching to using a GitHub Personal Access Token in order to be able to create PRs from a fork and not pollute the upstream branches.
- Loading branch information
1 parent
639ed26
commit 5497ef9
Showing
4 changed files
with
80 additions
and
7,633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ import {GithubConfig, setConfig} from '../../../ng-dev/utils/config.js'; | |
import {AuthenticatedGitClient} from '../../../ng-dev/utils/git/authenticated-git-client.js'; | ||
import {GithubRepo} from '../../../ng-dev/utils/git/github.js'; | ||
import {getRepositoryGitUrl} from '../../../ng-dev/utils/git/github-urls.js'; | ||
import {ANGULAR_ROBOT, getAuthTokenFor, revokeActiveInstallationToken} from '../../utils.js'; | ||
|
||
const enum ActionResult { | ||
created = 'created', | ||
|
@@ -18,8 +17,6 @@ main(); | |
|
||
// Helpers | ||
async function main(): Promise<void> { | ||
let authToken: string | null = null; | ||
|
||
try { | ||
// Initialize outputs. | ||
core.setOutput('result', ActionResult.nothing); | ||
|
@@ -35,10 +32,10 @@ async function main(): Promise<void> { | |
}; | ||
setConfig(config); | ||
|
||
// Configure the `AuthenticatedGitClient` to be authenticated with the token for the Angular | ||
// Robot. | ||
authToken = await getAuthTokenFor(ANGULAR_ROBOT); | ||
AuthenticatedGitClient.configure(authToken); | ||
// Configure the `AuthenticatedGitClient` to be authenticated with the provided GitHub access | ||
// token for Angular Robot. | ||
const accessToken = core.getInput('angular-robot-token', {required: true}); | ||
AuthenticatedGitClient.configure(accessToken); | ||
/** The authenticated GitClient. */ | ||
const git = await AuthenticatedGitClient.get(); | ||
git.run(['config', 'user.email', '[email protected]']); | ||
|
@@ -206,10 +203,6 @@ async function main(): Promise<void> { | |
core.setOutput('result', ActionResult.failed); | ||
core.error(err); | ||
core.setFailed(err.message); | ||
} finally { | ||
if (authToken !== null) { | ||
await revokeActiveInstallationToken(authToken); | ||
} | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.