Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'project-path' for the load-cache and save-cache commands #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jjacque
Copy link

@jjacque jjacque commented Jul 11, 2024

When having a reusable GH Actions job taking a directory as parameter, it can be useful to be able to set the path to the go.sum file as defining working_directory with parameters.XXX is not allowed.
For example:

jobs:
  go-check:
    executor:
      name: go/default
      tag: "1.21"
    parameters:
      dir:
        type: string
    steps:
      - checkout
      - go/load-cache:
          sumpath: "<< parameters.dir >>/go.sum"
      - run:
          name: Install dependencies
          command: |
            cd << parameters.dir >>
            go mod download
      - run:
          name: GolangCI Lint
          command: |
            cd << parameters.dir >>
            golangci-lint run
      - go/save-cache:
          sumpath: "<< parameters.dir >>/go.sum"

@jjacque jjacque requested a review from a team as a code owner July 11, 2024 23:39
@jjacque jjacque changed the title Implement 'sumpath' for the load-cache and save-cache commands Implement 'project-path' for the load-cache and save-cache commands Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants