Skip to content

Commit

Permalink
Minimize required privileges associated to the GitHub token to create…
Browse files Browse the repository at this point in the history
… issues (#1054)
  • Loading branch information
Ndpnt authored Feb 20, 2024
2 parents badf914 + be90c6e commit 9d04472
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## Unreleased [minor]

_Full changeset and discussions: [#1054](https://github.com/OpenTermsArchive/engine/pull/1054)._

> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs.
### Changed

- Minimize required privileges associated to the GitHub token to create issues in the declarations repository

## 0.36.1 - 2024-02-15

Expand Down
9 changes: 0 additions & 9 deletions src/reporter/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ export default class GitHub {
}

async initialize() {
try {
const { data: user } = await this.octokit.request('GET /user', { ...this.commonParams });

this.authenticatedUserLogin = user.login;
} catch (error) {
logger.error(`🤖 Could not get authenticated user: ${error}`);
}

this.MANAGED_LABELS = require('./labels.json');

const existingLabels = await this.getRepositoryLabels();
Expand Down Expand Up @@ -140,7 +132,6 @@ export default class GitHub {
const issues = await this.octokit.paginate('GET /repos/{owner}/{repo}/issues', {
...this.commonParams,
per_page: 100,
creator: this.authenticatedUserLogin,
...searchParams,
}, response => response.data);

Expand Down

0 comments on commit 9d04472

Please sign in to comment.