Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit ce64c96

Browse files
committed
Commit data fix
1 parent c36066b commit ce64c96

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ jobs:
4545
--image ${{ env.DOCKER_IMG }} \
4646
--project ${{ env.PROJECT_NAME }} \
4747
--region ${{ env.REGION }} \
48+
--port ${{ env.APP_PORT }} \
4849
--quiet \
4950
--platform managed

src/server.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ const GC_region = process.env.K_REGION || 'not set';
1818
const RELEASE_VERSION = process.env.RELEASE_VERSION || 'not set';
1919
const cloudURL = `https://console.cloud.google.com/run/detail/${GC_region}/${GC_service}/revisions&project=${GC_project}`;
2020

21-
let commitMessage = fs.readFileSync(path.join(__dirname, 'commit.txt'), {encoding: 'utf8', flag: 'r'});
21+
22+
23+
let commitMessage = 'not set';
24+
let commitFilePath = path.join(__dirname, 'commit.txt');
25+
if (fs.existsSync(commitFilePath)) {
26+
commitMessage = fs.readFileSync(commitFilePath, {encoding: 'utf8', flag: 'r'});
27+
}
2228

2329

2430
// app
@@ -37,7 +43,9 @@ app.get('/', (req, res) => {
3743
3844
<h2>GIT data:</h2>
3945
<pre>${commitMessage}</pre>
40-
<h3>${RELEASE_VERSION}</h3>
46+
47+
<h2>Release:</h2>
48+
<prev${RELEASE_VERSION}</h3>
4149
`;
4250

4351
res.send(response);

0 commit comments

Comments
 (0)