Skip to content

Commit

Permalink
Add checkout token to support private repos (#353)
Browse files Browse the repository at this point in the history
Flux-diff is not able to pull the repo if it is a private repo. Adding a
token to the checkout action appears to resolve that issue.

---------

Co-authored-by: Allen Porter <[email protected]>
  • Loading branch information
szinn and allenporter authored Jan 13, 2024
1 parent e76c0fe commit 4c6d07c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/flux-local-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ name: flux-local diff

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
diffs:
Expand Down
6 changes: 6 additions & 0 deletions action/diff/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ inputs:
sources:
description: GitRepository or OCIRepository to include with optional source mappings like `flux-system` or `cluster=./kubernetes/`
default: ''
token:
description: Token used for checkout action
default: '${{ github.token }}'
required: false
outputs:
diff:
description: Output of the diff command or empty if there is no diff
Expand Down Expand Up @@ -77,11 +81,13 @@ runs:
uses: actions/checkout@v4
with:
path: pr
token: ${{ inputs.token }}
- name: Checkout live branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.live-branch }}
path: live
token: ${{ inputs.token }}
- name: Diff Resources
id: flux_diff
run: |
Expand Down

0 comments on commit 4c6d07c

Please sign in to comment.