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 confidential-containers#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 <steven@uk.ibm.com>
  • Loading branch information
stevenhorsman authored and davidhIBM committed Oct 23, 2024
1 parent 30dcd4f commit ff4e06a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/e2e_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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 @@ -120,13 +124,19 @@ jobs:
# For debugging
ls ./target/release
popd
<<<<<<< HEAD

- name: Checkout Trustee Operator Repository
run: |
test/utils/checkout_trustee_operator.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

=======
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

>>>>>>> 0b7e7d99 (workflows: Install gh cli on self-hosted runner)
- name: run tests
id: runTests
env:
Expand Down

0 comments on commit ff4e06a

Please sign in to comment.