-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync from https://github.com/vmactions/base-vm
- Loading branch information
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.VM_TOKEN }} | ||
fetch-depth: '2' | ||
- name: Get latest release | ||
id: get-latest-release | ||
uses: InsonusK/[email protected] | ||
|
@@ -70,11 +71,14 @@ jobs: | |
#if only hash id in test.yml changes, skip | ||
currentHash="$(cat .github/workflows/test.yml | grep -i "uses: ${{ github.repository }}" | head -1 | cut -d @ -f 2)" | ||
echo "Current hash: $currentHash" | ||
parentHash="$OLD_HASH" | ||
echo "Parent hash: $parentHash" | ||
lastHash="$(git rev-parse 'HEAD~1')" | ||
echo "Last hash: $lastHash" | ||
oldHash="$lastHash" | ||
echo "OLD_HASH: $OLD_HASH" | ||
echo "Old hash using last hash: $oldHash" | ||
git diff | ||
cp .github/workflows/test.yml test.yml.back | ||
sed -i "s/$currentHash/$parentHash/g" .github/workflows/test.yml | ||
sed -i "s/$currentHash/$oldHash/g" .github/workflows/test.yml | ||
if git diff --quiet; then | ||
echo "no changes" | ||
else | ||
|
@@ -89,11 +93,11 @@ jobs: | |
newHash="$(git rev-parse main)" | ||
echo "New hash: $newHash" | ||
#modify test.yml | ||
sed -i "s/$parentHash/$newHash/g" .github/workflows/test.yml | ||
sed -i "s/$oldHash/$newHash/g" .github/workflows/test.yml | ||
fi | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "Update test hash" | ||
message: "Update from base vm" | ||
pull: '--rebase --autostash ' | ||
add: | | ||
.github/workflows/readme.yml | ||
|