Skip to content

Commit 5f08525

Browse files
committed
chore: Update artifact name to use regex pattern for test results in ci.yml
1 parent e9e7ad3 commit 5f08525

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
-H "Accept: application/vnd.github+json" \
171171
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
172172
-H "X-GitHub-Api-Version: 2022-11-28" \
173-
https://api.github.com/repos/${{ github.repository }}/actions/artifacts | jq -r '.artifacts | sort_by(.created_at) | .[] | select(.name == "Test Results") | .id' > artifacts_list.txt
173+
https://api.github.com/repos/${{ github.repository }}/actions/artifacts | jq -r '.artifacts | sort_by(.created_at) | .[] | select(.name == "^test-results") | .id' > artifacts_list.txt
174174
175175
LATEST_ARTIFACT_NUMBER=$(cut -d: -f 2 artifacts_list.txt | sort -n | tail -n 1)
176176
@@ -211,9 +211,12 @@ jobs:
211211
mvn -Dtest=$(basename $file | sed -e "s/.java/,/" | tr -d '\r\n') -e test -Dspring.datasource.url=${{ secrets.LIQUIBASE_COMMAND_URL }} -Dspring.datasource.username=${{ secrets.LIQUIBASE_COMMAND_USERNAME }} -Dspring.datasource.password=${{ secrets.LIQUIBASE_COMMAND_PASSWORD }} -Dspring.liquibase.change-log=classpath:db/changelog/changelog_version-3.3.xml -Dserver.port=8086 -Dspring.redis.host=redis -Dspring.redis.port=6379 -Dspring.redis.mode=standalone
212212
done
213213
214+
- name: Set timestamp
215+
run: echo "TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_ENV # setting the timestamp for the test results
216+
214217
- uses: actions/upload-artifact@v4 # upload the test results as an artifact
215218
with:
216-
name: Test Results
219+
name: test-results-${{ env.TIMESTAMP }} # naming the artifact with the timestamp
217220
path: ./target/surefire-reports # path to the test results
218221
retention-days: 90 # retention period for the artifact in days. Link to the documentation - https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#about-workflow-artifact-retention
219222

0 commit comments

Comments
 (0)