From 79bd69776c3dda4f539b3d83f81bb34d3b1d6140 Mon Sep 17 00:00:00 2001 From: Network Service Mesh Bot <60070799+nsmbot@users.noreply.github.com> Date: Wed, 4 Nov 2020 11:25:13 -0600 Subject: [PATCH] Update from update/networkservicemesh/cmd-template --- .github/workflows/ci.yaml | 22 +++++++++---------- .github/workflows/docker-push.yaml | 11 ++++++---- .../workflows/update-cmd-repositories.yaml | 4 ++-- .../update-integration-k8s-kind.yaml | 16 +++++--------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d5ecf64..e5cb497 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -209,23 +209,24 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} update-integration-k8s-kind: + needs: + - automerge name: Update integration-k8s-kind runs-on: ubuntu-latest - if: github.repository != 'networkservicemesh/cmd-template' + if: github.repository != 'networkservicemesh/cmd-template' && github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request' steps: - - name: Checkout repository + - name: Checkout ${{ github.repository }} uses: actions/checkout@v2 - - name: Find merged PR - uses: jwalton/gh-find-current-pr@v1 - id: findPr with: - github-token: ${{ github.token }} + path: ${{ github.repository }}S + ref: master + fetch-depth: '0' - name: Create commit message working-directory: ${{ github.repository }} run: | - echo "Update image version of ${{ github.repository }} ${{ github.repository }}#${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message + echo "Update application version to latest version from ${{ github.repository }}@master ${{ github.repository }}#${{ github.event.number }}" >> /tmp/commit-message echo "" >> /tmp/commit-message - echo "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message + echo "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}" >> /tmp/commit-message echo "" >> /tmp/commit-message echo "${{ github.repository }} commit message:" >> /tmp/commit-message git log -1 >> /tmp/commit-message @@ -237,9 +238,6 @@ jobs: path: networkservicemesh/integration-k8s-kind repository: networkservicemesh/integration-k8s-kind token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} - - uses: actions/setup-go@v1 - with: - go-version: 1.13.4 - uses: benjlevesque/short-sha@v1.1 id: short-sha with: @@ -269,7 +267,7 @@ jobs: git config --global user.name "NSMBot" git commit -s -F /tmp/commit-message git checkout -b update/"${branchName}" - while [ git push -f origin update/"${branchName}" ]; do + while [ git push origin update/"${branchName}" ]; do git fetch origin update/"${branchName}" git rebase origin/update/"${branchName}" done diff --git a/.github/workflows/docker-push.yaml b/.github/workflows/docker-push.yaml index 108f31f..d7a6dbc 100644 --- a/.github/workflows/docker-push.yaml +++ b/.github/workflows/docker-push.yaml @@ -11,22 +11,25 @@ jobs: env: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_USER: ${{ secrets.DOCKER_LOGIN }} - TAG: ${GITHUB_SHA::8} ORG: networkservicemeshci CGO_ENABLED: 0 NAME: ${{ github.event.repository.name }} if: github.repository != 'networkservicemesh/cmd-template' steps: - uses: actions/checkout@v2 + - uses: benjlevesque/short-sha@v1.1 + id: short-sha + with: + length: 8 - uses: actions/setup-go@v1 with: go-version: 1.15 - name: Build ${NAME} image - run: docker build . -t "${ORG}/${NAME}:${TAG}" --target runtime + run: docker build . -t "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}" --target runtime - name: Push ${NAME} image run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD - docker push "${ORG}/${NAME}:${TAG}" - docker image rm "${ORG}/${NAME}:${TAG}" + docker push "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}" + docker image rm "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}" docker push "${ORG}/${NAME}:latest" docker image rm "${ORG}/${NAME}:latest" diff --git a/.github/workflows/update-cmd-repositories.yaml b/.github/workflows/update-cmd-repositories.yaml index 390b098..1b97ad6 100644 --- a/.github/workflows/update-cmd-repositories.yaml +++ b/.github/workflows/update-cmd-repositories.yaml @@ -59,8 +59,8 @@ jobs: git restore --staged -- .templateignore && git restore -- .templateignore } || { - rm .templateignore - touch .templateignore + rm .templateignore && + touch .templateignore && git add .templateignore } while read -r line || [[ -n "$line" ]]; do diff --git a/.github/workflows/update-integration-k8s-kind.yaml b/.github/workflows/update-integration-k8s-kind.yaml index 5864a3b..cf3e966 100644 --- a/.github/workflows/update-integration-k8s-kind.yaml +++ b/.github/workflows/update-integration-k8s-kind.yaml @@ -11,19 +11,18 @@ jobs: runs-on: ubuntu-latest if: github.repository != 'networkservicemesh/cmd-template' steps: - - name: Checkout repository + - name: Checkout ${{ github.repository }} uses: actions/checkout@v2 - - name: Find merged PR - uses: jwalton/gh-find-current-pr@v1 - id: findPr with: - github-token: ${{ github.token }} + path: ${{ github.repository }}S + ref: master + fetch-depth: '0' - name: Create commit message working-directory: ${{ github.repository }} run: | - echo "Update image version of ${{ github.repository }} ${{ github.repository }}#${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message + echo "Update application version to latest version from ${{ github.repository }}@master ${{ github.repository }}#${{ github.event.number }}" >> /tmp/commit-message echo "" >> /tmp/commit-message - echo "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message + echo "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}" >> /tmp/commit-message echo "" >> /tmp/commit-message echo "${{ github.repository }} commit message:" >> /tmp/commit-message git log -1 >> /tmp/commit-message @@ -35,9 +34,6 @@ jobs: path: networkservicemesh/integration-k8s-kind repository: networkservicemesh/integration-k8s-kind token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} - - uses: actions/setup-go@v1 - with: - go-version: 1.13.4 - uses: benjlevesque/short-sha@v1.1 id: short-sha with: