-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix missing imports, bad func usage, add fail check when release …
…in progress (#1261) <!-- For Coveo Employees only. Fill this section. CDX-724 --> ## Proposed changes - Fixes missing imports that caused https://github.com/coveo/cli/actions/runs/4597808599/jobs/8121171408 ❌ - Fix-it-twice: Typescript checks on the JS files. (I elected a JS check instead of using compilation or ts-node to KISS) - Add further protection against merging while a release is in progress ## New protections Currently (assuming it was working), if a PR has all its checks ✅, we as admin could still merge it. The only solution to prevent an admin to merge is to make a check of the PR to fail To do that, I used the logic we had for the 'rogue' package-lock protection: a check that exit 1 or 0 depending on the presence of a file or not. To enforce it, I need to "Requires branches to be up to date before merging", otherwise no further checks would be made. So now to lock the branch: - We verify the main branch hasn't changed - We write and commit-push a 'lockfile' into the repo: this is the actual 'lock': from here, until this file get removed from master, nothing can go in or out. - We reset the local to the commit before (indeed we don't want to keep this file or commit) - We continue the process as usual - When we set where `master` should ref, we use 'force' because it is not a fast-forward operation. (i.e. we want to remove 'gitlock'
- Loading branch information
1 parent
f4cfde4
commit d4309a4
Showing
9 changed files
with
186 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'master lock validator' | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
paths: | ||
- '.git-lock' | ||
|
||
jobs: | ||
git-locked: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- run: exit 1 |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'master lock validator' | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
paths-ignore: | ||
- '.git-lock' | ||
|
||
jobs: | ||
git-locked: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- run: exit 0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "nodenext", | ||
"allowJs": true, | ||
"checkJs": true, | ||
"skipLibCheck": true, | ||
"noEmit": true | ||
}, | ||
"exclude": ["node_modules"], | ||
"include": ["*.mjs"] | ||
} |