Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
postalsys
emailengine
Repository navigation
Code
Pull requests
Actions
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
emailengine
/
update-info.sh
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
34 lines (32 loc) · 1.42 KB
master
Breadcrumbs
emailengine
/
update-info.sh
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
34 lines (32 loc) · 1.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Resolve the commit hash for version-info.json:
# 1. EE_COMMIT_HASH is the explicit override, and the only source the Docker
# image build and the release builds have - neither runs in a checkout with
# a usable .git. The Dockerfile requires it; here it is optional
# 2. git rev-parse works in any normal checkout, also when refs are packed;
# the toplevel check makes sure the hash comes from this repository and
# not from an unrelated parent repository when this directory is not a
# git repository itself
#
# There used to be a third branch reading .git/refs/heads/master directly. It
# existed only for the Docker build, which copied that one file into the context;
# the build now takes the arg instead, so nothing could reach it. It was also
# doubly unreliable - hardcoded to one branch name, and a fresh clone packs its
# refs away so the file need not exist at all.
#
# An unresolved hash is left empty rather than failing, because the remaining
# callers that supply nothing (render.yaml) still want a version-info.json.
if [ -n "$EE_COMMIT_HASH" ]; then
COMMIT_HASH="$EE_COMMIT_HASH"
elif [ "$(git rev-parse --show-toplevel 2>/dev/null)" = "$(pwd -P)" ] && git rev-parse HEAD >/dev/null 2>&1; then
COMMIT_HASH=$(git rev-parse HEAD)
else
COMMIT_HASH=""
fi
TIMESTAMP=$(node -e 'console.log(Date.now())')
cat >version-info.json <<EOL
{
"commit": "${COMMIT_HASH}",
"time": "${TIMESTAMP}"
}
EOL
You can’t perform that action at this time.