Skip to content

Commit

Permalink
Revert "only allow using tokens in environment creator that do not ex…
Browse files Browse the repository at this point in the history
…pire"

This reverts commit 0de8f0b.
  • Loading branch information
rikukissa committed Aug 26, 2024
1 parent 209dd1e commit ba8162b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,23 @@
- Supporting document fields can now be made required
- If there is only one option in the document uploader select, then it stays hidden and only the upload button is showed with the only option being selected by default

## 1.5.0
* **ElasticSearch reindexing**

Allows reindexing ElasticSearch via a new search-service endpoint `reindex`. We're replacing the original `ocrvs` index with timestamped ones. This is done automatically when upgrading and migrating, but this is an important architectural change that should be noted. More details in [#7033](https://github.com/opencrvs/opencrvs-core/pull/7033).

- Introduce a new certificate handlebar "preview" which can be used to conditionally render some svg element when previewing the certificate e.g. background image similar to security paper

### New content keys requiring translation

```
INSERT CSV ROWS IN ENGLISH ONLY
```

## Bug fixes

- Github pipeline dedicated for reading secrets and variables from other environments now checks if GH_TOKEN is still valid before attempting other operations

## 1.5.0 (https://github.com/opencrvs/opencrvs-countryconfig/compare/v1.4.1...v1.5.0)

### Breaking changes

Expand Down
9 changes: 0 additions & 9 deletions infrastructure/environments/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ export async function updateVariable(
)
}

export async function getTokenExpiry(octokit: Octokit) {
const res = await octokit.request('GET /user')
const expiry = res.headers['github-authentication-token-expiration']
if (!expiry) {
return null
}
return new Date(expiry)
}

export async function getRepositoryId(
octokit: Octokit,
owner: string,
Expand Down
8 changes: 0 additions & 8 deletions infrastructure/environments/setup-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
createRepositorySecret,
createVariable,
getRepositoryId,
getTokenExpiry,
listEnvironmentSecrets,
listEnvironmentVariables,
listRepositorySecrets,
Expand Down Expand Up @@ -824,13 +823,6 @@ const SPECIAL_NON_APPLICATION_ENVIRONMENTS = ['jump', 'backup']
auth: githubToken
})

const expiry = await getTokenExpiry(octokit)
if (expiry) {
error('Your Github token expires at:', expiry.toLocaleString())
error('Please create a new token with "No expiration" and try again.')
process.exit(1)
}

await createEnvironment(
octokit,
environment,
Expand Down

0 comments on commit ba8162b

Please sign in to comment.