From b5c79134a224efbae31a51e7080348d4fc8f0e59 Mon Sep 17 00:00:00 2001 From: Andy Wu Date: Sat, 11 May 2024 15:58:28 -0700 Subject: [PATCH] [feat] add pr-internal workflow --- .github/workflows/pr-external.yaml | 39 ++++++++++++++++++++++++++++++ .github/workflows/pr-internal.yml | 34 ++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/pr-external.yaml create mode 100644 .github/workflows/pr-internal.yml diff --git a/.github/workflows/pr-external.yaml b/.github/workflows/pr-external.yaml new file mode 100644 index 00000000..d2cf3ad3 --- /dev/null +++ b/.github/workflows/pr-external.yaml @@ -0,0 +1,39 @@ +name: Workflow for External PRs + +on: + pull_request_target: + types: [opened, synchronize] + +jobs: + Timestamp_PR_CREATED: + uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main + + authorize: + if: github.event.pull_request.head.repo.full_name != github.repository + needs: [ Timestamp_PR_CREATED ] + environment: 'external' + runs-on: ubuntu-latest + steps: + - run: true + + Timestamp_PR_APPROVED: + needs: [ authorize ] + uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main + + build_and_test: + needs: [ authorize, Timestamp_PR_APPROVED ] + uses: storyprotocol/gha-workflows/.github/workflows/reusable-build-test-workflow.yml@feat/add_reusable_build_test_workflow + with: + sha: ${{ github.event.pull_request.head.sha }} + ENVIRONMENT: 'beta-sepolia' + secrets: + RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} + WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} + TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }} + SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.SEPOLIA_RPC_PROVIDER_URL }} + TEST_SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.TEST_SEPOLIA_RPC_PROVIDER_URL }} + SEPOLIA_WALLET_PRIVATE_KEY: ${{ secrets.SEPOLIA_WALLET_PRIVATE_KEY }} + SEPOLIA_TEST_WALLET_ADDRESS: ${{ secrets.SEPOLIA_TEST_WALLET_ADDRESS }} + STORY_TEST_NET_RPC_PROVIDER_URL: ${{ secrets.STORY_TEST_NET_RPC_PROVIDER_URL }} + STORY_TEST_NET_WALLET_PRIVATE_KEY: ${{ secrets.STORY_TEST_NET_WALLET_PRIVATE_KEY }} + STORY_TEST_NET_TEST_WALLET_ADDRESS: ${{ secrets.STORY_TEST_NET_TEST_WALLET_ADDRESS }} diff --git a/.github/workflows/pr-internal.yml b/.github/workflows/pr-internal.yml new file mode 100644 index 00000000..22e75c72 --- /dev/null +++ b/.github/workflows/pr-internal.yml @@ -0,0 +1,34 @@ +name: Workflow for internal PRs + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + - dev + +jobs: + + Timestamp: + uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main + + build_and_test: + needs: [Timestamp] + uses: storyprotocol/gha-workflows/.github/workflows/reusable-build-test-workflow.yml@feat/add_reusable_build_test_workflow + with: + sha: ${{ github.event.pull_request.head.sha }} + ENVIRONMENT: 'beta-sepolia' + secrets: + RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} + WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} + TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }} + SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.SEPOLIA_RPC_PROVIDER_URL }} + TEST_SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.TEST_SEPOLIA_RPC_PROVIDER_URL }} + SEPOLIA_WALLET_PRIVATE_KEY: ${{ secrets.SEPOLIA_WALLET_PRIVATE_KEY }} + SEPOLIA_TEST_WALLET_ADDRESS: ${{ secrets.SEPOLIA_TEST_WALLET_ADDRESS }} + STORY_TEST_NET_RPC_PROVIDER_URL: ${{ secrets.STORY_TEST_NET_RPC_PROVIDER_URL }} + STORY_TEST_NET_WALLET_PRIVATE_KEY: ${{ secrets.STORY_TEST_NET_WALLET_PRIVATE_KEY }} + STORY_TEST_NET_TEST_WALLET_ADDRESS: ${{ secrets.STORY_TEST_NET_TEST_WALLET_ADDRESS }}