livetest: fix cloning of repo

Previously it was checking out origin/master not the PR's branch.
This commit is contained in:
Katerina Koukiou 2021-02-24 10:48:36 +01:00 committed by GitHub
parent 350621b443
commit 66c6e96406
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,11 +46,28 @@ jobs:
sudo apt update sudo apt update
sudo apt install -y cockpit-system cockpit-ws nodejs npm sassc make sudo apt install -y cockpit-system cockpit-ws nodejs npm sassc make
- name: Clone repository - uses: actions/github-script@v3
uses: actions/checkout@v2 id: get-pr
with: with:
# need this to also fetch tags script: |
const request = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
}
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
try {
const result = await github.pulls.get(request)
return result.data
} catch (err) {
core.setFailed(`Request failed with error ${err}`)
}
- uses: actions/checkout@v2
with:
repository: ${{ fromJSON(steps.get-pr.outputs.result).head.repo.full_name }}
fetch-depth: 0 fetch-depth: 0
ref: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
- name: Compile and install the project - name: Compile and install the project
run: make && sudo make install run: make && sudo make install