Skip to content

Commit

Permalink
workflows: Install gh cli on self-hosted runner
Browse files Browse the repository at this point in the history
In #2077 I forgot about pull_request_target not testing
workflows in PRs and that self-hosted runners wouldn't
have the gh cli installed, so this attempts to fix the workflows
and install gh cli first.

I also set `GH_TOKEN` env in the step that uses `gh` based on the
`gh help environment` doc that states:
GH_TOKEN: an authentication token for github.com API requests.
Setting this avoids being prompted to authenticate.

Note: I did find a few actions to do this, but they were only used by single digit
projects, so I figured it would be safer to do it ourselves for now

Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman authored and wainersm committed Oct 10, 2024
1 parent edc0cc1 commit 0b7e7d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/e2e_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ jobs:
override: true
profile: minimal

- name: Install gh cli
run: |
sudo apt install -y gh
- name: Checkout kbs Repository and build kbs-client
run: |
sudo apt-get update -y
Expand All @@ -117,6 +121,8 @@ jobs:
# For debugging
ls ./target/release
popd
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: run tests
id: runTests
Expand Down

0 comments on commit 0b7e7d9

Please sign in to comment.