Commit d6f2654
authored
chore: [REL-4161] ensure tag is being created in the correct directory (#556)
There was a missing line here to get into the correct directory. This
was just an oversight [^1]. However, the error was quite alarming, and
it turns out there's some less-than-ideal git practices here that I'll
definitely be cleaning up once I finally get this release out the door.
The tl;dr is that we have the main coderefs tool that lives in this repo
and we have two other repos that contain the coderefs GHA and the
coderefs Bitbucket Pipe. As it happens, we are cloning those repos into
directories _inside_ the main repo. This seems like a very bad idea, and
I can't imagine any possible benefit from doing that. Anyway, in this
case, since the `cd githubActionsMetadataUpdates` line was missing, I
was still in the `ld-find-code-refs` repo (where the 2.14.0 tag had
already been created), and so the
[error](https://github.com/launchdarkly/ld-find-code-refs/actions/runs/16786640560/job/47538679234#step:7:785)
I got was `fatal: tag 'v2.14.0' already exists` 😬. This could have been
very bad depending on what git operations I was doing. I'll make sure
this gets fixed up in the very near term.
[^1]: I typically opt for `()`-style (instead of `{}`-style) functions
in the shell because local variables behave how you would expect. This
style of function creates a subshell, so any kind of file system
navigation is not preserved. I had assumed since the `setup_gha`
finishes in the `githubActionsMetadataUpdates` directory, that's where I
would be when running the git commands. But since that function ran in a
subshell, I was put back in the `ld-find-code-refs` root directory (the
directory my GHA is run from).
<!-- ld-jira-link -->
---
Related Jira issue: [REL-4161: Migrate ld-find-code-refs from Releaser
to GHA](https://launchdarkly.atlassian.net/browse/REL-4161)
<!-- end-ld-jira-link -->1 parent 2c3137e commit d6f2654
2 files changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
0 commit comments