Explorar el Código

update Github auth token

Mohammed Nafees hace 4 años
padre
commit
d30ba1de15
Se han modificado 1 ficheros con 41 adiciones y 20 borrados
  1. 41 20
      .github/workflows/prerelease.yaml

+ 41 - 20
.github/workflows/prerelease.yaml

@@ -408,16 +408,17 @@ jobs:
           echo ::set-output name=tag::$tag
         env:
           GITHUB_TAG: ${{ github.ref }}
-      - name: Checkout
-        uses: actions/checkout@v2.3.4
-        with:
-          repository: 'porter-dev/porter-update-action'
-          token: ${{ secrets.GITHUB_TOKEN }}
       - name: Push new branch with updated CLI
         run: |
           git config user.name "Update Bot"
           git config user.email "support@porter.run"
 
+          cd $GITHUB_WORKSPACE
+
+          git clone https://abelanger5:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/porter-update-action
+
+          cd porter-update-action
+
           git checkout -b "${{steps.tag_name.outputs.tag}}"
 
           cat >Dockerfile <<EOL
@@ -428,6 +429,8 @@ jobs:
           ENTRYPOINT ["/action/entrypoint.sh"]
           EOL
 
+          git commit -m "Update to CLI version ${{steps.tag_name.outputs.tag}}"
+
           git push --set-upstream origin ${{steps.tag_name.outputs.tag}}
   update-porter-cli-action:
     name: Update porter-cli-action
@@ -441,16 +444,17 @@ jobs:
           echo ::set-output name=tag::$tag
         env:
           GITHUB_TAG: ${{ github.ref }}
-      - name: Checkout
-        uses: actions/checkout@v2.3.4
-        with:
-          repository: 'porter-dev/porter-cli-action'
-          token: ${{ secrets.GITHUB_TOKEN }}
       - name: Push new branch with updated CLI
         run: |
           git config user.name "Update Bot"
           git config user.email "support@porter.run"
 
+          cd $GITHUB_WORKSPACE
+
+          git clone https://abelanger5:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/porter-cli-action
+
+          cd porter-cli-action
+
           git checkout -b "${{steps.tag_name.outputs.tag}}"
 
           cat >Dockerfile <<EOL
@@ -461,21 +465,38 @@ jobs:
           ENTRYPOINT ["/action/entrypoint.sh"]
           EOL
 
+          git commit -m "Update to CLI version ${{steps.tag_name.outputs.tag}}"
+
           git push --set-upstream origin ${{steps.tag_name.outputs.tag}}
   invoke-new-release-tests-workflows:
-    name: Invoke new-release-tests Github workflows
+    name: Update new-release-tests
     runs-on: ubuntu-latest
     needs: [update-porter-update-action, update-porter-cli-action]
     steps:
-      - name: Run new-release-tests/.github/workflows/porter_test_docker_production.yml
+      - name: Get tag name
+        id: tag_name
         run: |
-          gh workflow run porter_test_docker_production.yml --repo porter-dev/new-release-tests
+          tag=${GITHUB_TAG/refs\/tags\//}
+          echo ::set-output name=tag::$tag
         env:
-          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
-          GH_ENV: $
-      - name: Run new-release-tests/.github/workflows/porter_test_pack_production.yml
+          GITHUB_TAG: ${{ github.ref }}
+      - name: Update new-release-tests
         run: |
-          gh workflow run porter_test_pack_production.yml --repo porter-dev/new-release-tests
-        env:
-          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
-          GH_ENV: $
+          git config user.name "Update Bot"
+          git config user.email "support@porter.run"
+
+          cd $GITHUB_WORKSPACE
+
+          git clone https://abelanger5:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/new-release-tests
+
+          cd new-release-tests/.github/workflows
+
+          sed -i '' 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_pack_production.yml
+          sed -i '' 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_pack_production.yml
+
+          sed -i '' 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_docker_production.yml
+          sed -i '' 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_docker_production.yml
+
+          git commit -m "Update to Porter GHA version ${{steps.tag_name.outputs.tag}}"
+
+          git push