Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
Update common CI files to latest version from networkservicemesh/cmd-…
Browse files Browse the repository at this point in the history
…template@master networkservicemesh/cmd-template#45

networkservicemesh/cmd-template PR link: networkservicemesh/cmd-template#45

networkservicemesh/cmd-template commit message:
commit 4558c78de90a6a04846df663a46cf7a107f6f064
Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com>
Date:   Fri Nov 20 14:15:04 2020 +0700

    add missed working-directory (#45)

    Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
  • Loading branch information
NSMBot committed Nov 20, 2020
1 parent 09f8058 commit 9fab31d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 37 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ jobs:
path: ${{ github.repository }}
repository: ${{ github.repository }}
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- name: Create branch name
working-directory: ${{ github.repository }}
run: |
diff=$(git diff --name-only)
BRANCH_NAME="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
BRANCH_NAME="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${BRANCH_NAME}"
} || {
echo Branch update/"${BRANCH_NAME}" is already deleted
}
fi;
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
Expand All @@ -239,7 +256,7 @@ jobs:
path: networkservicemesh/integration-k8s-kind
repository: networkservicemesh/integration-k8s-kind
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: benjlevesque/short-sha@v1.1
- uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 8
Expand All @@ -257,24 +274,11 @@ jobs:
echo Repository already up to date
exit 0;
fi
diff=$(git diff --name-only)
branchName="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
branchName="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${branchName}"
} || {
echo Branch update/"${branchName}" is already deleted
}
fi;
git config --global user.email "nsmbot@networkservicmesh.io"
git config --global user.name "NSMBot"
git commit -s -F /tmp/commit-message
git checkout -b update/"${branchName}"
while [ $(git push origin update/"${branchName}") ]; do
git fetch origin update/"${branchName}"
git rebase origin/update/"${branchName}"
git checkout -b update/"${BRANCH_NAME}"
while [ $(git push origin update/"${BRANCH_NAME}") ]; do
git fetch origin update/"${BRANCH_NAME}"
git rebase origin/update/"${BRANCH_NAME}"
done
2 changes: 1 addition & 1 deletion .github/workflows/pr-for-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
echo ${PULL_REQUEST_BODY}
echo PULL_REQUEST_BODY=${PULL_REQUEST_BODY} >> $GITHUB_ENV
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.6
uses: vsoch/pull-request-action@1.0.12
env:
GITHUB_TOKEN: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/update-integration-k8s-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ jobs:
path: ${{ github.repository }}
repository: ${{ github.repository }}
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- name: Create branch name
working-directory: ${{ github.repository }}
run: |
diff=$(git diff --name-only)
BRANCH_NAME="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
BRANCH_NAME="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${BRANCH_NAME}"
} || {
echo Branch update/"${BRANCH_NAME}" is already deleted
}
fi;
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
Expand All @@ -34,7 +51,7 @@ jobs:
path: networkservicemesh/integration-k8s-kind
repository: networkservicemesh/integration-k8s-kind
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: benjlevesque/short-sha@v1.1
- uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 8
Expand All @@ -52,24 +69,11 @@ jobs:
echo Repository already up to date
exit 0;
fi
diff=$(git diff --name-only)
branchName="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
branchName="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${branchName}"
} || {
echo Branch update/"${branchName}" is already deleted
}
fi;
git config --global user.email "nsmbot@networkservicmesh.io"
git config --global user.name "NSMBot"
git commit -s -F /tmp/commit-message
git checkout -b update/"${branchName}"
while [ $(git push origin update/"${branchName}") ]; do
git fetch origin update/"${branchName}"
git rebase origin/update/"${branchName}"
git checkout -b update/"${BRANCH_NAME}"
while [ $(git push origin update/"${BRANCH_NAME}") ]; do
git fetch origin update/"${BRANCH_NAME}"
git rebase origin/update/"${BRANCH_NAME}"
done

0 comments on commit 9fab31d

Please sign in to comment.