Skip to content

switch to composite build and add api key check#28

Merged
willnorris merged 2 commits intomainfrom
will/check-auth-empty
Jan 29, 2024
Merged

switch to composite build and add api key check#28
willnorris merged 2 commits intomainfrom
will/check-auth-empty

Conversation

@willnorris
Copy link
Copy Markdown
Member

This prepares for merging #24. Manually tested in a private repo on a test tailnet.

Go is already installed on GitHub Action runners, so this simplifies our
action slightly by removing Docker. More importantly, it allows us to
run other steps such as validating inputs, similar to what we do in
tailscale/github-action.

Signed-off-by: Will Norris <will@tailscale.com>
This is effectively a noop right now, since the api-key input is
required. This is in preparation for merging #24 where you can specify
an api-key or oauth credentials.

Signed-off-by: Will Norris <will@tailscale.com>
exit 1
- uses: actions/setup-go@v4.0.0
with:
go-version: 1.21.6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend referencing the go.mod file so as to not have to increment this manually:

     - name: Install Go
       uses: actions/setup-go@v4
       with:
         go-version-file: go.mod
         cache: false

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no go.mod file in this repo, and I don't think we can reference the one from tailscale/tailscale

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this isn't OSS. There isn't a go.mod. Never mind.

@willnorris willnorris merged commit b579b2f into main Jan 29, 2024
@willnorris willnorris deleted the will/check-auth-empty branch January 29, 2024 21:26
@oscar-b
Copy link
Copy Markdown

oscar-b commented Feb 6, 2024

@willnorris Hey! This seems to break on our self hosted runners:

Run go install tailscale.com/cmd/gitops-pusher@gitops-1.58.2
  go install tailscale.com/cmd/gitops-pusher@gitops-1.58.2
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    GOBIN: /usr/local/bin/
tailscale.com/cmd/gitops-pusher: go install tailscale.com/cmd/gitops-pusher: copying /tmp/go-build2096326023/b001/exe/a.out: open /usr/local/bin/gitops-pusher: permission denied

Not sure if we should just allow our gh user access to /usr/local/bin? Not sure how this is configured on GitHubs runners.

@oscar-b
Copy link
Copy Markdown

oscar-b commented Feb 6, 2024

As an alternative solution, I'm running the workflow in a container instead:

container: golang:1.21.6-bookworm

willnorris added a commit that referenced this pull request Mar 21, 2024
Self-hosted runners sometimes can't write the built binary to
/usr/local/bin, so just use `go run` instead.

Updates #28

Signed-off-by: Will Norris <will@tailscale.com>
Co-authored-by: Mario Minardi <mario@tailscale.com>
willnorris added a commit that referenced this pull request Mar 21, 2024
Self-hosted runners sometimes can't write the built binary to
/usr/local/bin, so just use `go run` instead.

Updates #28

Signed-off-by: Will Norris <will@tailscale.com>
Co-authored-by: Mario Minardi <mario@tailscale.com>
willnorris added a commit that referenced this pull request Mar 21, 2024
Self-hosted runners sometimes can't write the built binary to
/usr/local/bin, so just use `go run` instead.

Updates #28

Signed-off-by: Will Norris <will@tailscale.com>
Co-authored-by: Mario Minardi <mario@tailscale.com>
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.

3 participants