Skip to content

Commit

Permalink
Use get-latest action to avoid skip issues with git after CVE-2022-24765
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed May 4, 2022
1 parent 1efd27b commit 08dea40
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@ jobs:

- name: Checkout
uses: actions/checkout@v3

- uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
with:
fetch-depth: 0
semver_only: true
initial_version: 0.0.1

- name: Prepare .changes file
# The .changes file is updated only in release creation. This current task should be improved
Expand All @@ -252,18 +256,16 @@ jobs:
CHANGES_FILE=$PACKAGE_NAME.changes
osc checkout $OBS_PROJECT $PACKAGE_NAME $CHANGES_FILE
mv $CHANGES_FILE $FOLDER
VERSION=$(./hack/get_version_from_git.sh)
TAG=$(echo $VERSION | cut -f1 -d+)
hack/gh_release_to_obs_changeset.py $REPOSITORY -a [email protected] -t $TAG -f $FOLDER/$CHANGES_FILE
VERSION=${{ steps.latest-tag.outputs.tag }}
hack/gh_release_to_obs_changeset.py $REPOSITORY -a [email protected] -t $VERSION -f $FOLDER/$CHANGES_FILE
- name: Set version
run: |
VERSION=$(./hack/get_version_from_git.sh)
TAG=$(echo $VERSION | cut -f1 -d+)
VERSION=${{ steps.latest-tag.outputs.tag }}
sed -i 's~%%REVISION%%~${{ github.sha }}~' $FOLDER/_service && \
sed -i 's~%%REPOSITORY%%~${{ github.repository }}~' $FOLDER/_service && \
sed -i 's~%%VERSION%%~'"${TAG}"'~' $FOLDER/_service && \
sed -i 's~%%VERSION%%~'"${TAG}"'~' $FOLDER/Dockerfile
sed -i 's~%%VERSION%%~'"${VERSION}"'~' $FOLDER/_service && \
sed -i 's~%%VERSION%%~'"${VERSION}"'~' $FOLDER/Dockerfile
- name: Configure OSC
# OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home
Expand Down

0 comments on commit 08dea40

Please sign in to comment.