Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from update/networkservicemesh/cmd-template #148

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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