Comments (8)
${GITHUB_REF:11}? is that a typo or is that really what's needed?
Sadly it is not a typo 😄 . It's a bash trick for string manipulation, basically says "return $GITHUB_REF
starting at character position 11 (trims off refs/heads/
)."
I'm currently working on first class support for Github actions v2 for ld-find-code-refs, so I'd recommend waiting for that to land. I expect to have it ready this week.
Edit: see "Substring Extraction" on https://www.tldp.org/LDP/abs/html/string-manipulation.html
from find-code-references.
You're a beast!
Thanks for your support!
from find-code-references.
Hi @HoughIO, thanks for the report. We were internally aware of this issue but dropped the ball on addressing it.
As you've already determined, github actions v2 contains a breaking change. v1 cloned the repo into the action container and checked it out to the correct branch. v2 removes this functionality and asks the user to manually include the actions/checkout
step. Unfortunately that action leaves the repo in a detached head state rather than checked out to a branch, like in v1.
The fix is simple - we need ld-find-code-refs
to read the branch name from $GITHUB_REF
rather than try to get it from git
as we do now. Until we make that change, there is a hacky workaround for getting this v2 action to work. You could add the following action in between actions/checkout
and the code references action:
- name: Prepare repository
run: git checkout "${GITHUB_REF:11}"
This just gets the repo out of the detached head state so the current version of ld-find-code-refs can run.
My recommendation would be to wait on using this v2 action until we have shipped v2 compatibility to ld-find-code-refs
. I will post again to this issue when that is done.
Thanks, and apologies for the trouble.
from find-code-references.
${GITHUB_REF:11}
? is that a typo or is that really what's needed?
from find-code-references.
Although taking another look at this, the new format requires the codebase to be cloned with the actions/checkout@v1
action located here. Which seems to not be a specific branch, but checks out the ref based on the pull request data sent in the payload.
from find-code-references.
That's a good hack!
GITHUB_REF
The branch or tag ref that triggered the workflow. For example,
refs/heads/feature-branch-1
. If neither a branch or tag is available for the event type, the variable will not exist.
--
So it would be the current branch!
Neat!
from find-code-references.
Slick!
from find-code-references.
This issue is fixed in the v2
release of find-code-references
.
If you update your workflows to uses: launchdarkly/find-code-references@v2
things should just work.
Thanks for the reports!
from find-code-references.
Related Issues (16)
- v9 not released? HOT 1
- Contribute a default value for `githubToken` input HOT 1
- Monorepo support for only scanning specific sub directories HOT 5
- warning: debug option 'false' unknown; try LD_DEBUG=help HOT 3
- ERROR: 2021/08/24 17:00:46 coderefs.go:276: error retrieving repository: unauthorized, check your LaunchDarkly access token HOT 2
- Action fails on forked repositories HOT 1
- Tag numbering causes Dependabot to produce erroneous update PRs HOT 3
- The default branch has been renamed - January 9, 2023
- Changes made to version tags - January 9, 2023
- LaunchDarkly API responded with status code 403 HOT 7
- Actions running for hours HOT 2
- Action Can't Execute Alias Command File HOT 6
- runtime error: index out of range [65533] with length 58363 HOT 1
- skipping code reference pruning: authentication required HOT 1
- Error: Parsing GITHUB_REF in v6 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from find-code-references.