René's URL Explorer Experiment


Title: Fall back to GITHUB_SHA env var if git is not available by robertbrignull · Pull Request #84 · github/codeql-action · GitHub

Open Graph Title: Fall back to GITHUB_SHA env var if git is not available by robertbrignull · Pull Request #84 · github/codeql-action

X Title: Fall back to GITHUB_SHA env var if git is not available by robertbrignull · Pull Request #84 · github/codeql-action

Description: There have been problems regarding a new dependency on being able to run git commands. In some environment git is not present, or a .git directory is not created unless git is a high-enough version. In other cases people want to analyze without a full checkout, for example analysing container images. This PR means we still try to use git to get the current commit, because we need to do this in the case of PR integration. However if that fails for any reason then we almost silently give up and just return the commit SHA from the environment. I argue this will be correct in almost all situations, and even if it was incorrect the fallout from alerts appearing on the wrong commit is not too bad in the case of pull requests and likely understandable to the user. I've tested this with a self-hosted runner that did not have a high enough version of git, and it failed on the main branch but succeeded with this branch. Merge / deployment checklist Run test builds as necessary. Can be on this repository or elsewhere as needed in order to test the change - please include links to tests in other repos! CodeQL using init/analyze actions 3rd party tool using upload action Confirm this change is backwards compatible with existing workflows. Confirm the readme has been updated if necessary.

Open Graph Description: There have been problems regarding a new dependency on being able to run git commands. In some environment git is not present, or a .git directory is not created unless git is a high-enough version...

X Description: There have been problems regarding a new dependency on being able to run git commands. In some environment git is not present, or a .git directory is not created unless git is a high-enough version...

Opengraph URL: https://github.com/github/codeql-action/pull/84

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4a3de8fc-5ac6-18d8-7fdc-51d3ca4a3492
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB678:3A03DF:661791:8E181A:6A5385AB
html-safe-noncec04c5ff9c8dd0315d9d18a884bf5eed9286a52d577b6fea7f50a689643f8715d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjc4OjNBMDNERjo2NjE3OTE6OEUxODFBOjZBNTM4NUFCIiwidmlzaXRvcl9pZCI6IjMwMzk2NzQyNTEyNDQ0Mzg5NTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacacfacb163cc141583fd06400bd4ca5225b42dfc8f7928a860c68ae284e89689f
hovercard-subject-tagpull_request:440090732
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql-action/pull/84/files
twitter:imagehttps://avatars.githubusercontent.com/u/3749000?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/3749000?s=400&v=4
og:image:altThere have been problems regarding a new dependency on being able to run git commands. In some environment git is not present, or a .git directory is not created unless git is a high-enough version...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql-action git https://github.com/github/codeql-action.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id259445878
octolytics-dimension-repository_nwogithub/codeql-action
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id259445878
octolytics-dimension-repository_network_root_nwogithub/codeql-action
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql-action/pull/84/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F84%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F84%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql-action
Reloadhttps://github.com/github/codeql-action/pull/84/files
Reloadhttps://github.com/github/codeql-action/pull/84/files
Reloadhttps://github.com/github/codeql-action/pull/84/files
Please reload this pagehttps://github.com/github/codeql-action/pull/84/files
github https://github.com/github
codeql-actionhttps://github.com/github/codeql-action
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Fork 471 https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Star 1.6k https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Code https://github.com/github/codeql-action
Issues 156 https://github.com/github/codeql-action/issues
Pull requests 24 https://github.com/github/codeql-action/pulls
Actions https://github.com/github/codeql-action/actions
Models https://github.com/github/codeql-action/models
Security and quality 2 https://github.com/github/codeql-action/security
Insights https://github.com/github/codeql-action/pulse
Code https://github.com/github/codeql-action
Issues https://github.com/github/codeql-action/issues
Pull requests https://github.com/github/codeql-action/pulls
Actions https://github.com/github/codeql-action/actions
Models https://github.com/github/codeql-action/models
Security and quality https://github.com/github/codeql-action/security
Insights https://github.com/github/codeql-action/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
robertbrignullhttps://github.com/robertbrignull
mainhttps://github.com/github/codeql-action/tree/main
remove_git_dependencyhttps://github.com/github/codeql-action/tree/remove_git_dependency
Conversation 0 https://github.com/github/codeql-action/pull/84
Findings https://github.com/github/codeql-action/pull/84/findings
Commits 1 https://github.com/github/codeql-action/pull/84/commits
Checks 0 https://github.com/github/codeql-action/pull/84/checks
Files changed https://github.com/github/codeql-action/pull/84/files
Please reload this pagehttps://github.com/github/codeql-action/pull/84/files
Fall back to GITHUB_SHA env var if git is not available https://github.com/github/codeql-action/pull/84/files#top
Show all changes 1 commit https://github.com/github/codeql-action/pull/84/files
0fdc2c7 fall back to GITHUB_SHA env var if git is not available robertbrignull Jun 25, 2020 https://github.com/github/codeql-action/pull/84/commits/0fdc2c71e4137d8be2a5fdc2a6c12091f6be6255
Clear filters https://github.com/github/codeql-action/pull/84/files
Please reload this pagehttps://github.com/github/codeql-action/pull/84/files
Please reload this pagehttps://github.com/github/codeql-action/pull/84/files
util.js https://github.com/github/codeql-action/pull/84/files#diff-3fb720f70ea34fb2975fd6c38ac4b6b6131373be2abfa4760dfaae8a25daaee2
util.js.map https://github.com/github/codeql-action/pull/84/files#diff-709978ba6652a9d1f2f2cfb89f74b8743ec9a8aac0470253725ecf2c62a1651e
util.ts https://github.com/github/codeql-action/pull/84/files#diff-3294a832ea2276e554177e0b3007cc2d401c082912c7fbde49fa09141bf1aed1
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
lib/util.jshttps://github.com/github/codeql-action/pull/84/files#diff-3fb720f70ea34fb2975fd6c38ac4b6b6131373be2abfa4760dfaae8a25daaee2
View file https://github.com/github/codeql-action/blob/0fdc2c71e4137d8be2a5fdc2a6c12091f6be6255/lib/util.js
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/github/codeql-action/pull/84/files
Please reload this pagehttps://github.com/github/codeql-action/pull/84/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.