Skip to content

Commit

Permalink
Merge pull request #49 from puzzle/dagger-caching
Browse files Browse the repository at this point in the history
Add gha caching
  • Loading branch information
schlapzz authored Jul 20, 2023
2 parents 5d975b8 + 3c21679 commit 084140f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
types: [opened, reopened, synchronize]

permissions:
id-token: write # Important for at least docker gha cache
contents: read

jobs:
dagger:
Expand Down Expand Up @@ -36,11 +39,17 @@ jobs:
-
name: Install
run: go get dagger.io/dagger@latest
-
name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v2
-
name: Release and deploy with Dagger
run: go run ci/main.go
run: |
export _EXPERIMENTAL_DAGGER_CACHE_CONFIG="type=gha,mode=max,url=$ACTIONS_CACHE_URL,token=$ACTIONS_RUNTIME_TOKEN"
go run ci/main.go
env:
REGISTRY_PASSWORD: '${{ secrets.REGISTRY_PASSWORD }}'
REGISTRY_USER: '${{ secrets.REGISTRY_USER }}'
GITHUB_ACCESS_TOKEN: '${{ secrets.GH_ACCESS_TOKEN }}'
REGISTRY_URL: '${{ secrets.REGISTRY_URL }}'

2 changes: 1 addition & 1 deletion cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var diffCmd = &cobra.Command{
Use: "diff",
Short: "Diff files [sourceDir] [targetDir]",
Args: cobra.ExactArgs(2),
Long: `Generate diff between two directories`,
Long: `Generate diff between two directories. You can use the --include optoin to include or exclude certain files with a glob pattern`,
RunE: func(cmd *cobra.Command, args []string) error {
found, err := diff.Diff(*title, *markdown, args[0], args[1], *glob, *outputDir, *exitCode)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Execute() {
log.SetLevel(level)
err = rootCmd.Execute()
if err != nil {
//If exit code is set on diff sub command, exit is handled directly in the diff subcommand
os.Exit(1)
}
}
Expand Down

0 comments on commit 084140f

Please sign in to comment.