Skip to content

Commit 2bab85a

Browse files
authored
Fix GitHub spelling (#8118)
1 parent 91d82f8 commit 2bab85a

File tree

18 files changed

+90
-90
lines changed

18 files changed

+90
-90
lines changed

app/lib/account/agent.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class KnownAgents {
2525
///
2626
/// Deprecated and should not be used for new audit-log entries.
2727
/// This value is still present in some older audit-log entries.
28-
static const _genericGithubActions = 'service:github-actions';
28+
static const _genericGitHubActions = 'service:github-actions';
2929

3030
/// Non-specific agent - only specifies it is from GCP Service Account.
3131
///
@@ -67,7 +67,7 @@ abstract class KnownAgents {
6767
];
6868

6969
static const _nonSpecificAgentIds = <String>{
70-
_genericGithubActions,
70+
_genericGitHubActions,
7171
_genericGcpServiceAccount,
7272
pubSupport,
7373
};
@@ -132,15 +132,15 @@ abstract class AuthenticatedAgent {
132132
/// Holds the authenticated GitHub Action information.
133133
///
134134
/// The [agentId] has the following format: `service:github-actions:<repositoryOwnerId>/<repositoryId>`
135-
class AuthenticatedGithubAction implements AuthenticatedAgent {
135+
class AuthenticatedGitHubAction implements AuthenticatedAgent {
136136
@override
137137
late final agentId = KnownAgents.githubActionsAgentId(
138138
repositoryOwnerId: payload.repositoryOwnerId,
139139
repositoryId: payload.repositoryId,
140140
);
141141

142142
@override
143-
String get displayId => KnownAgents._genericGithubActions;
143+
String get displayId => KnownAgents._genericGitHubActions;
144144

145145
/// OIDC `id_token` the request was authenticated with.
146146
///
@@ -155,7 +155,7 @@ class AuthenticatedGithubAction implements AuthenticatedAgent {
155155
/// The parsed, GitHub-specific JWT payload.
156156
final GitHubJwtPayload payload;
157157

158-
AuthenticatedGithubAction({
158+
AuthenticatedGitHubAction({
159159
required this.idToken,
160160
required this.payload,
161161
}) {

app/lib/account/backend.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Future<AuthenticatedAgent?> _tryAuthenticateServiceAgent(String token) async {
170170
if (payload == null) {
171171
throw AuthenticationException.tokenInvalid('unable to parse payload');
172172
}
173-
return AuthenticatedGithubAction(
173+
return AuthenticatedGitHubAction(
174174
idToken: idToken,
175175
payload: payload,
176176
);

app/lib/account/default_auth_provider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ abstract class BaseAuthProvider extends AuthProvider {
207207
if (idToken.payload.iss == GitHubJwtPayload.issuerUrl) {
208208
// The token claims to be issued by GitHub. If there is any problem
209209
// with the token, the authentication should fail without any fallback.
210-
await _verifyToken(idToken, openIdDataFetch: fetchGithubOpenIdData);
210+
await _verifyToken(idToken, openIdDataFetch: fetchGitHubOpenIdData);
211211
return idToken;
212212
}
213213

app/lib/audit/models.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class AuditLogRecord extends db.ExpandoModel<String> {
232232
static Map<String, dynamic> _dataForPublishing({
233233
required AuthenticatedAgent uploader,
234234
}) {
235-
if (uploader is AuthenticatedGithubAction) {
235+
if (uploader is AuthenticatedGitHubAction) {
236236
final runId = uploader.payload.runId;
237237
final sha = uploader.payload.sha;
238238
return <String, dynamic>{
@@ -256,7 +256,7 @@ class AuditLogRecord extends db.ExpandoModel<String> {
256256
if (version != null) ' version `$version`',
257257
if (publisherId != null) ' owned by publisher `$publisherId`',
258258
];
259-
if (uploader is AuthenticatedGithubAction) {
259+
if (uploader is AuthenticatedGitHubAction) {
260260
final repository = uploader.payload.repository;
261261
final runId = uploader.payload.runId;
262262
final sha = uploader.payload.sha;

app/lib/fake/backend/fake_auth_provider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ String _createGcpToken({
273273
}
274274

275275
@visibleForTesting
276-
String createFakeGithubActionToken({
276+
String createFakeGitHubActionToken({
277277
required String repository,
278278
required String ref,
279279
// `https://pub.dev` unless specified otherwise

app/lib/frontend/templates/views/pkg/admin_page.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ d.Node packageAdminPageNode({
267267
d.Node _automatedPublishing(Package package) {
268268
final github = package.automatedPublishing?.githubConfig;
269269
final gcp = package.automatedPublishing?.gcpConfig;
270-
final isGithubEnabled = github?.isEnabled ?? false;
270+
final isGitHubEnabled = github?.isEnabled ?? false;
271271
return d.fragment([
272272
d.a(name: 'automated-publishing'),
273273
d.h2(text: 'Automated publishing'),
@@ -281,13 +281,13 @@ d.Node _automatedPublishing(Package package) {
281281
child: material.checkbox(
282282
id: '-pkg-admin-automated-github-enabled',
283283
label: 'Enable publishing from GitHub Actions',
284-
checked: isGithubEnabled,
284+
checked: isGitHubEnabled,
285285
),
286286
),
287287
d.div(
288288
classes: [
289289
'-pub-form-checkbox-indent',
290-
if (!isGithubEnabled) '-pub-form-block-hidden',
290+
if (!isGitHubEnabled) '-pub-form-block-hidden',
291291
],
292292
children: [
293293
d.div(
@@ -368,7 +368,7 @@ d.Node _automatedPublishing(Package package) {
368368
value: github?.environment,
369369
),
370370
),
371-
if (isGithubEnabled) _exampleGithubWorkflow(github!),
371+
if (isGitHubEnabled) _exampleGitHubWorkflow(github!),
372372
],
373373
),
374374
d.a(name: 'google-cloud-service-account'),
@@ -415,7 +415,7 @@ d.Node _automatedPublishing(Package package) {
415415
]);
416416
}
417417

418-
d.Node _exampleGithubWorkflow(GithubPublishingConfig github) {
418+
d.Node _exampleGitHubWorkflow(GitHubPublishingConfig github) {
419419
final expandedTagPattern = (github.tagPattern ?? '{{version}}')
420420
.replaceAll('{{version}}', '[0-9]+.[0-9]+.[0-9]+*');
421421
final requireEnvironment = github.requireEnvironment;

app/lib/package/backend.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ final maxAssetContentLength = 256 * 1024;
5858
final _defaultMaxVersionsPerPackage = 1000;
5959

6060
final Logger _logger = Logger('pub.cloud_repository');
61-
final _validGithubUserOrRepoRegExp =
61+
final _validGitHubUserOrRepoRegExp =
6262
RegExp(r'^[a-z0-9\-\._]+$', caseSensitive: false);
63-
final _validGithubVersionPattern =
63+
final _validGitHubVersionPattern =
6464
RegExp(r'^[a-z0-9\-._]+$', caseSensitive: false);
65-
final _validGithubEnvironment =
65+
final _validGitHubEnvironment =
6666
RegExp(r'^[a-z0-9\-\._]+$', caseSensitive: false);
6767

6868
/// Sets the package backend service.
@@ -546,8 +546,8 @@ class PackageBackend {
546546
InvalidInputException.check(parts.length == 2,
547547
'The `repository` field must follow the `<owner>/<repository>` pattern.');
548548
InvalidInputException.check(
549-
_validGithubUserOrRepoRegExp.hasMatch(parts[0]) &&
550-
_validGithubUserOrRepoRegExp.hasMatch(parts[1]),
549+
_validGitHubUserOrRepoRegExp.hasMatch(parts[0]) &&
550+
_validGitHubUserOrRepoRegExp.hasMatch(parts[1]),
551551
'The `repository` field has invalid characters.');
552552
}
553553

@@ -557,7 +557,7 @@ class PackageBackend {
557557
InvalidInputException.check(
558558
tagPatternParts
559559
.where((e) => e.isNotEmpty)
560-
.every(_validGithubVersionPattern.hasMatch),
560+
.every(_validGitHubVersionPattern.hasMatch),
561561
'The `tagPattern` field has invalid characters.');
562562

563563
InvalidInputException.check(
@@ -566,7 +566,7 @@ class PackageBackend {
566566

567567
if (environment.isNotEmpty) {
568568
InvalidInputException.check(
569-
_validGithubEnvironment.hasMatch(environment),
569+
_validGitHubEnvironment.hasMatch(environment),
570570
'The `environment` field has invalid characters.');
571571
}
572572
}
@@ -1308,8 +1308,8 @@ class PackageBackend {
13081308
await packageBackend.isPackageAdmin(package, agent.user.userId)) {
13091309
return;
13101310
}
1311-
if (agent is AuthenticatedGithubAction) {
1312-
await _checkGithubActionAllowed(agent, package, newVersion);
1311+
if (agent is AuthenticatedGitHubAction) {
1312+
await _checkGitHubActionAllowed(agent, package, newVersion);
13131313
return;
13141314
}
13151315
if (agent is AuthenticatedGcpServiceAccount) {
@@ -1323,7 +1323,7 @@ class PackageBackend {
13231323
agent.displayId, package.name!);
13241324
}
13251325

1326-
Future<void> _checkGithubActionAllowed(AuthenticatedGithubAction agent,
1326+
Future<void> _checkGitHubActionAllowed(AuthenticatedGitHubAction agent,
13271327
Package package, String newVersion) async {
13281328
final githubConfig = package.automatedPublishing?.githubConfig;
13291329
final githubLock = package.automatedPublishing?.githubLock;
@@ -1676,15 +1676,15 @@ class PackageBackend {
16761676
Package package, AuthenticatedAgent agent) {
16771677
final current = package.automatedPublishing;
16781678
if (current == null) {
1679-
if (agent is AuthenticatedGithubAction ||
1679+
if (agent is AuthenticatedGitHubAction ||
16801680
agent is AuthenticatedGcpServiceAccount) {
16811681
// This should be unreachable
16821682
throw AssertionError('Authentication should never have been possible');
16831683
}
16841684
return;
16851685
}
1686-
if (agent is AuthenticatedGithubAction && current.githubLock == null) {
1687-
current.githubLock = GithubPublishingLock(
1686+
if (agent is AuthenticatedGitHubAction && current.githubLock == null) {
1687+
current.githubLock = GitHubPublishingLock(
16881688
repositoryOwnerId: agent.payload.repositoryOwnerId,
16891689
repositoryId: agent.payload.repositoryId,
16901690
);

app/lib/package/models.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ class Release {
473473

474474
@JsonSerializable(explicitToJson: true, includeIfNull: false)
475475
class AutomatedPublishing {
476-
GithubPublishingConfig? githubConfig;
477-
GithubPublishingLock? githubLock;
476+
GitHubPublishingConfig? githubConfig;
477+
GitHubPublishingLock? githubLock;
478478
GcpPublishingConfig? gcpConfig;
479479
GcpPublishingLock? gcpLock;
480480

@@ -524,19 +524,19 @@ class AutomatedPublishingProperty extends db.Property {
524524
}
525525

526526
@JsonSerializable(explicitToJson: true, includeIfNull: false)
527-
class GithubPublishingLock {
527+
class GitHubPublishingLock {
528528
final String repositoryOwnerId;
529529
final String repositoryId;
530530

531-
GithubPublishingLock({
531+
GitHubPublishingLock({
532532
required this.repositoryOwnerId,
533533
required this.repositoryId,
534534
});
535535

536-
factory GithubPublishingLock.fromJson(Map<String, dynamic> json) =>
537-
_$GithubPublishingLockFromJson(json);
536+
factory GitHubPublishingLock.fromJson(Map<String, dynamic> json) =>
537+
_$GitHubPublishingLockFromJson(json);
538538

539-
Map<String, dynamic> toJson() => _$GithubPublishingLockToJson(this);
539+
Map<String, dynamic> toJson() => _$GitHubPublishingLockToJson(this);
540540
}
541541

542542
@JsonSerializable(explicitToJson: true, includeIfNull: false)

app/lib/package/models.g.dart

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/lib/service/openid/github_openid.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'openid_utils.dart';
1414
final _logger = Logger('github_openid');
1515

1616
/// Fetches the OpenID configuration and then the JSON Web Key list from GitHub.
17-
Future<OpenIdData> fetchGithubOpenIdData() async {
17+
Future<OpenIdData> fetchGitHubOpenIdData() async {
1818
final githubUrl =
1919
'https://token.actions.githubusercontent.com/.well-known/openid-configuration';
2020
final list = await cache

0 commit comments

Comments
 (0)