diff --git a/.github/workflows/close_pylon_issue.yml b/.github/workflows/close_pylon_issue.yml index 7469a77b5..4ad679116 100644 --- a/.github/workflows/close_pylon_issue.yml +++ b/.github/workflows/close_pylon_issue.yml @@ -3,16 +3,13 @@ name: Close Pylon Ticket on Issue or Pull Request Closure on: issues: types: [closed] - pull_request: + pull_request_target: types: [closed] jobs: close_pylon_ticket: runs-on: ubuntu-latest steps: - - name: Check out the repository - uses: actions/checkout@v2 - - name: Extract Pylon Ticket ID id: extract_ticket_id run: | @@ -20,12 +17,12 @@ jobs: ISSUE_BODY=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}" | jq -r '.body') pylon_ticket_id=$(echo "$ISSUE_BODY" | grep -oP '(?<=)') - elif [[ "${{ github.event_name }}" == 'pull_request' ]]; then + elif [[ "${{ github.event_name }}" =~ ^pull_request ]]; then PR_BODY=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" | jq -r '.body') pylon_ticket_id=$(echo "$PR_BODY" | grep -oP '(?<=)') fi - echo "::set-output name=pylon_ticket_id::$pylon_ticket_id" + echo "pylon_ticket_id=$pylon_ticket_id" >> "$GITHUB_OUTPUT" - name: Close Pylon Ticket if: steps.extract_ticket_id.outputs.pylon_ticket_id != '' diff --git a/.github/workflows/create_pylon_issue.yml b/.github/workflows/create_pylon_issue.yml index 2dc435a98..a43dafd7d 100644 --- a/.github/workflows/create_pylon_issue.yml +++ b/.github/workflows/create_pylon_issue.yml @@ -3,16 +3,13 @@ name: Create Pylon Issue on: issues: types: [opened] - pull_request: + pull_request_target: types: [opened] jobs: create_pylon_issue: runs-on: ubuntu-latest steps: - - name: Check out the repository - uses: actions/checkout@v2 - - name: Install jq run: sudo apt-get install -y jq @@ -46,7 +43,7 @@ jobs: "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}" - name: Create Pylon Issue for Pull Request - if: github.event_name == 'pull_request' + if: contains(github.event_name, 'pull_request') run: | response=$(curl --request POST \ --url https://api.usepylon.com/issues \ diff --git a/.github/workflows/test-main-warehouse.yml b/.github/workflows/test-main-warehouse.yml index e33271512..048443b0f 100644 --- a/.github/workflows/test-main-warehouse.yml +++ b/.github/workflows/test-main-warehouse.yml @@ -1,6 +1,6 @@ name: Test main warehouse platform on: - pull_request: + pull_request_target: branches: ["master"] paths: - elementary/** @@ -13,4 +13,5 @@ jobs: uses: ./.github/workflows/test-warehouse.yml with: warehouse-type: postgres + elementary-ref: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.sha) || '' }} secrets: inherit diff --git a/.github/workflows/test-warehouse.yml b/.github/workflows/test-warehouse.yml index 11b6ca48e..f583c684a 100644 --- a/.github/workflows/test-warehouse.yml +++ b/.github/workflows/test-warehouse.yml @@ -77,6 +77,7 @@ env: jobs: test: runs-on: ubuntu-latest + environment: elementary_test_env # This is a github environment (not to be confused with env vars) defaults: run: working-directory: elementary