Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
leximpact-socio-fiscal-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur socio-fiscal
leximpact-socio-fiscal-api
Commits
899ab29f
Commit
899ab29f
authored
Jan 4, 2022
by
Emmanuel Raviart
Browse files
Options
Downloads
Patches
Plain Diff
Harden reset of git repository.
parent
2bb44685
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab-ci/src/gitlab-ci.ts
+1
-0
1 addition, 0 deletions
gitlab-ci/src/gitlab-ci.ts
with
1 addition
and
0 deletions
gitlab-ci/src/gitlab-ci.ts
+
1
−
0
View file @
899ab29f
...
@@ -441,6 +441,7 @@ function objectFromVersion(
...
@@ -441,6 +441,7 @@ function objectFromVersion(
async
function
resetGitRepository
()
{
async
function
resetGitRepository
()
{
// Reset current repo, because it may have been tranformed by a previous CI that failed.
// Reset current repo, because it may have been tranformed by a previous CI that failed.
await
$
`git reset --hard`
await
$
`git switch
${
CI_COMMIT_BRANCH
}
`
await
$
`git switch
${
CI_COMMIT_BRANCH
}
`
await
$
`git fetch origin
${
CI_COMMIT_BRANCH
}
`
await
$
`git fetch origin
${
CI_COMMIT_BRANCH
}
`
await
$
`git reset --hard origin/
${
CI_COMMIT_BRANCH
}
`
await
$
`git reset --hard origin/
${
CI_COMMIT_BRANCH
}
`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment