From 84cc76ebf492a767ad6309b12a6858af3a41d4fd Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Wed, 20 Sep 2023 13:57:37 -0700 Subject: [PATCH] ci: updated branch PR logic (#1578) --- .github/workflows/version-branch-update.yaml | 71 +++++++++++--------- scripts/netlify.sh | 2 +- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/version-branch-update.yaml b/.github/workflows/version-branch-update.yaml index 6ba7f896ed..2192312ae2 100644 --- a/.github/workflows/version-branch-update.yaml +++ b/.github/workflows/version-branch-update.yaml @@ -1,7 +1,7 @@ name: Version Branch Update on: - pull_request: + pull_request_target: branches: - 'version-[0-9]-[0-9]' types: [opened, synchronize, reopened] @@ -38,7 +38,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 @@ -50,36 +50,41 @@ jobs: - run: npm ci - - name: Post Netlify progress - uses: mshick/add-pr-comment@v2 - with: - message: | - 🤖 Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes. - refresh-message-position: true - update-only: true - - name: Netlify Build + - name: compile run: | - make versions-ci - netlify build --context deploy-preview - - - - name: Deploy to Netlify - id: netlify - uses: nwtgck/actions-netlify@v2.1.0 - with: - publish-dir: ./build - deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}' - enable-pull-request-comment: true - overwrites-pull-request-comment: true - enable-commit-comment: true - - - name: Post Netlify URL - uses: mshick/add-pr-comment@v2 - with: - message: | - 🚀 Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes. - message-failure: | - 👎 Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information. - refresh-message-position: true - update-only: true \ No newline at end of file + make build + + # - name: Post Netlify progress + # uses: mshick/add-pr-comment@v2 + # with: + # message: | + # 🤖 Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes. + # refresh-message-position: true + # update-only: true + + # - name: Netlify Build + # run: | + # make versions-ci + # netlify build --context deploy-preview + + + # - name: Deploy to Netlify + # id: netlify + # uses: nwtgck/actions-netlify@v2.1.0 + # with: + # publish-dir: ./build + # deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}' + # enable-pull-request-comment: true + # overwrites-pull-request-comment: true + # enable-commit-comment: true + + # - name: Post Netlify URL + # uses: mshick/add-pr-comment@v2 + # with: + # message: | + # 🚀 Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes. + # message-failure: | + # 👎 Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information. + # refresh-message-position: true + # update-only: true \ No newline at end of file diff --git a/scripts/netlify.sh b/scripts/netlify.sh index b0b4f8f90f..39bce4e1bd 100755 --- a/scripts/netlify.sh +++ b/scripts/netlify.sh @@ -6,7 +6,7 @@ # List of branches to NOT create an automatic Netlify preview -disallowed_branches=("master" "release-*" "version-*") +disallowed_branches=("master" "release-*") # Get current branch name current_branch=$(git branch --show-current)