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 and login. From local testing I think that's enough
as `gh api` doesn't require the repo to be passed in, but if we want
to expand the gh commands we use in future we might need
additional envs set.

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 committed Oct 10, 2024
1 parent edc0cc1 commit 2388548
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/azure-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}


- name: Install and set-up gh cli
run: |
sudo apt install -y gh
gh auth login --with-token < ${GH_TOKEN}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create peerpod subnet
run: |
NODE_RG="$(az aks show -g ${{ secrets.AZURE_RESOURCE_GROUP }} -n "$CLUSTER_NAME" --query nodeResourceGroup -o tsv)"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/e2e_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ jobs:
override: true
profile: minimal

- name: Install and set-up gh cli
run: |
sudo apt install -y gh
gh auth login --with-token < ${GH_TOKEN}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout kbs Repository and build kbs-client
run: |
sudo apt-get update -y
Expand Down

0 comments on commit 2388548

Please sign in to comment.