Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch only commit sha from GET PR #821

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ jobs:
outputs:
version: ${{ steps.vars.outputs.version }}
clustername: ${{ steps.vars.outputs.clustername }}
pr: ${{ steps.pr.outputs.result }}
merge_commit_sha: ${{ steps.merge_commit_sha.outputs.result }}
steps:
- name: Get PR ref
- name: Get PR Commit SHA
uses: actions/github-script@v7
id: pr
id: merge_commit_sha
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest
return pullRequest.merge_commit_sha
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}}
ref: ${{steps.merge_commit_sha.outputs.result}}
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -100,13 +100,13 @@ jobs:
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
pr: ${{ needs.build.outputs.pr }}
merge_commit_sha: ${{ needs.build.outputs.merge_commit_sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{fromJSON(needs.build.outputs.pr).merge_commit_sha}}
ref: ${{ needs.build.outputs.merge_commit_sha }}
- name: Setup kubectl
uses: azure/setup-kubectl@v4
- name: Run E2E tests
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
pr: ${{ needs.build.outputs.pr }}
merge_commit_sha: ${{ needs.build.outputs.merge_commit_sha }}
env:
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
Expand All @@ -151,7 +151,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{fromJSON(needs.build.outputs.pr).merge_commit_sha}}
ref: ${{ needs.build.outputs.merge_commit_sha }}
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
pr: ${{ needs.build.outputs.pr }}
merge_commit_sha: ${{ needs.build.outputs.merge_commit_sha }}
env:
VSPHERE_USER: ${{ secrets.CI_VSPHERE_USER }}
VSPHERE_PASSWORD: ${{ secrets.CI_VSPHERE_PASSWORD }}
Expand All @@ -205,7 +205,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{fromJSON(needs.build.outputs.pr).merge_commit_sha}}
ref: ${{ needs.build.outputs.merge_commit_sha }}
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -239,13 +239,13 @@ jobs:
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
pr: ${{ needs.build.outputs.pr }}
merge_commit_sha: ${{ needs.build.outputs.merge_commit_sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{fromJSON(needs.build.outputs.pr).merge_commit_sha}}
ref: ${{ needs.build.outputs.merge_commit_sha }}
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand Down
Loading