Skip to content

Commit eb22163

Browse files
committed
fix: github action
1 parent 1722c66 commit eb22163

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/check-tengine.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
schedule:
66
- cron: '0 0 * * *'
77

8+
permissions:
9+
contents: write
10+
packages: write
11+
812
jobs:
913
upgrade-container-version:
1014
name: "Upgrade container version"
@@ -24,21 +28,21 @@ jobs:
2428
with:
2529
repository: alibaba/tengine
2630
ref: master
27-
path: int.tmp/repo
31+
path: int.tmp
2832
fetch-tags: true
2933
fetch-depth: 0
3034

3135
- name: Check version
3236
id: check-version
3337
shell: bash
3438
run: |
35-
cd int.tmp/repo
39+
cd int.tmp
3640
TAG=$(git tag -l '[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -n 1)
3741
git checkout $TAG
3842
echo -n "${TAG#v}" > version
3943
cd ..
4044
41-
LAST_VERSION=$(cat ./int.tmp/repo/version)
45+
LAST_VERSION=$(cat ./int.tmp/version)
4246
CURRENT_VERSION=$(cat ./tengine/version)
4347
IFS='.' read -r -a last_version_parts <<< "$LAST_VERSION"
4448
IFS='.' read -r -a current_version_parts <<< "$CURRENT_VERSION"
@@ -82,13 +86,17 @@ jobs:
8286

8387
- name: Build and push container image
8488
if: steps.check-version.outputs.action == 'update'
85-
run: make push PROJECT=tengine VERSION=${{ needs.check.outputs.action }}
89+
run: |
90+
version="${{ steps.check-version.outputs.version }}"
91+
make push PROJECT=tengine VERSION=$version
8692
8793
- name: Git version change and push
8894
if: steps.check-version.outputs.action == 'update'
8995
run: |
90-
git config --global user.name "Sebastian Vargas"
91-
git config --global user.email "sebastian.varbel@gmail.com"
96+
author_name=$(git log -1 --pretty=format:'%an')
97+
author_email=$(git log -1 --pretty=format:'%ae')
98+
git config --global user.name "${author_name}"
99+
git config --global user.email "${author_email}"
92100
93101
version="${{ steps.check-version.outputs.version }}"
94102
echo -n "${version}" > tengine/version

0 commit comments

Comments
 (0)