diff --git a/.github/workflows/try.yml b/.github/workflows/try.yml index 074d5c660a..703663a24e 100644 --- a/.github/workflows/try.yml +++ b/.github/workflows/try.yml @@ -3,38 +3,56 @@ name: Try Build on: issue_comment: types: [created, edited, deleted] + push: + branches: + - fix_try permissions: contents: read issues: write - pull-requests: read + pull-requests: write jobs: try: - if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/try') }} + # if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/try') }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - name: Get Pull Request Number + id: pr + run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: peter-evans/create-or-update-comment@v4 with: - issue-number: ${{ github.event.pull_request.number }} + id: init-comment + # issue-number: ${{ github.event.pull_request.number }} + issue-number: ${{ steps.pr.outputs.pull_request_number }} body: | - 'Okay, starting a try! I\'ll comment again once the build starts...' + Okay, starting a try! I\'ll comment again once the build starts... - - uses: xt0rted/pull-request-comment-branch@v2 - id: comment-branch + # - uses: xt0rted/pull-request-comment-branch@v2 + # id: comment-branch - uses: "buildkite/trigger-pipeline-action@v2.1.0" id: run-build with: buildkite_api_access_token: ${{ secrets.BUILDKITE_TOKEN }} # TODO(johnrwatson): This is Scott's Token at the minute, needs rotated pipeline: "system-initiative/si-merge-queue" - branch: ${{ steps.comment-branch.outputs.head_ref }} - message: ":github: Try for branch ${{ steps.comment-branch.outputs.head_ref }}" + # branch: ${{ steps.comment-branch.outputs.head_ref }} + # message: ":github: Try for branch ${{ steps.comment-branch.outputs.head_ref }}" + branch: $GITHUB_REF + message: ":github: Try for branch $GITHUB_REF" ignore_pipeline_branch_filter: true send_pull_request: true - uses: peter-evans/create-or-update-comment@v4 with: - issue-number: ${{ github.event.pull_request.number }} + # issue-number: ${{ github.event.pull_request.number }} + issue-number: ${{ steps.pr.outputs.pull_request_number }} + comment-id: ${{ steps.init-comment.outputs.comment-id }}" body: | - `🚀 [Try running here](${{ steps.run-build.outputs.url }}! 🚀` + 🚀 [Try running here](${{ steps.run-build.outputs.url }})! 🚀