From 7b91fa28a6fdeef53bab080801a72d1a70ba8a07 Mon Sep 17 00:00:00 2001 From: Zander Chocron Date: Mon, 25 Apr 2022 11:56:29 -0700 Subject: [PATCH 1/2] Pass variables and set commit status --- .../hosted-notebook-samples-check.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hosted-notebook-samples-check.yml b/.github/workflows/hosted-notebook-samples-check.yml index 7d9cab370995..0e7f079a0c35 100644 --- a/.github/workflows/hosted-notebook-samples-check.yml +++ b/.github/workflows/hosted-notebook-samples-check.yml @@ -4,17 +4,27 @@ on: pull_request: branches: - feature/samples-gallery - workflow_dispatch: - +env: + pipelineVars: '{''qcHash'': ''${{ github.sha }}'', ''githubRepo'': ''${{ github.repository }}'', ''prCommitHash'': ''${{ github.event.pull_request.head.sha }}'', ''isGithubPrBuild'': ''true'' }' + jobs: build: name: Call Azure Pipeline runs-on: ubuntu-latest steps: - name: Azure Pipelines Action - uses: Azure/pipelines@v1 + uses: Azure/pipelines@v1.2 with: azure-devops-project-url: ${{ secrets.QUANTUM_PROGRAM_ADO_URL }} azure-pipeline-name: ${{ secrets.HOSTED_NOTEBOOKS_PIPELINE_NAME }} azure-devops-token: ${{ secrets.HOSTED_NOTEBOOKS_PIPELINE_ADO_PAT }} - azure-pipeline-variables: '{"Quantum Computing Samples Commit Hash": "$GITHUB_SHA"}' + azure-pipeline-variables: ${{ env.pipelineVars }} + - name: Set status to pending + run: | + curl \ + -X POST \ + -H "Accept: application/json" \ + -u achocron:${{ secrets.GITHUB_TOKEN }} https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \ + -d '{"state":"pending", "description": "Triggering Notebook Samples E2E Test"}' + + From bd82bd6809d653341deade6abb793bcbc09911db Mon Sep 17 00:00:00 2001 From: Zander Chocron Date: Mon, 25 Apr 2022 12:16:19 -0700 Subject: [PATCH 2/2] Update hosted-notebook-samples-check.yml --- .github/workflows/hosted-notebook-samples-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hosted-notebook-samples-check.yml b/.github/workflows/hosted-notebook-samples-check.yml index 0e7f079a0c35..b5f4cce054d8 100644 --- a/.github/workflows/hosted-notebook-samples-check.yml +++ b/.github/workflows/hosted-notebook-samples-check.yml @@ -25,6 +25,6 @@ jobs: -X POST \ -H "Accept: application/json" \ -u achocron:${{ secrets.GITHUB_TOKEN }} https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \ - -d '{"state":"pending", "description": "Triggering Notebook Samples E2E Test"}' + -d '{"state":"pending", "description": "Waiting to be run", "context": "Notebook Samples E2E Test"}'