-
Notifications
You must be signed in to change notification settings - Fork 115
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
Feature: add workflow detection action #35
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6013230
add workflow detection action
asraa 6c9aa4b
add permission
asraa 739f879
update
asraa 089bfca
set output correctly
asraa 0081096
remove local test
asraa 38f1565
use go code
asraa 9b20c22
fix output
asraa dd7e3ad
update
asraa File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang@sha256:3b7fa1bed1510cfdadbbd839ab1c2c4ca5ee86bc259d2cb71142f6bd4e70b59f as builder | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN go get -d -v | ||
|
||
# Statically compile our app for use in a distroless container | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -v -o app . | ||
|
||
# A distroless container image with some basics like SSL certificates | ||
# https://github.com/GoogleContainerTools/distroless | ||
FROM gcr.io/distroless/static@sha256:0bec8e882c023de03ba9ed6bb07cd6b5e52b19fb1641505ea1b1c8937f3ccc7d | ||
|
||
COPY --from=builder /app/app /app | ||
|
||
ENTRYPOINT ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Detect Reusable Workflow Repository and Ref' | ||
description: 'Get the current reusable workflow repository name and ref. Requires "id-token: write" permission' | ||
outputs: | ||
repository: | ||
description: The current workflow repository, format org/repository | ||
value: ${{ steps.detect.outputs.repository }} | ||
ref: | ||
description: The current workflow reference | ||
value: ${{ steps.detect.outputs.ref }} | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module github.com/slsa-framework/slsa-github-generator/.github/actions/detect-workflow | ||
|
||
go 1.18 | ||
|
||
require github.com/slsa-framework/slsa-github-generator v0.0.0-20220418072137-6847f817dbea | ||
|
||
require ( | ||
github.com/coreos/go-oidc v2.2.1+incompatible // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 // indirect | ||
golang.org/x/crypto v0.0.0-20220213190939-1e6e3497d506 // indirect | ||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect | ||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect | ||
google.golang.org/appengine v1.6.7 // indirect | ||
google.golang.org/protobuf v1.28.0 // indirect | ||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little late, but I was wondering if we could avoid dockerfile by using:
I ask because docker build/run take longer, and because it would avoid maintaining the hashes in the docker file.
I don't know if this code works, though.. especially the part on checkout. I feel that it might, the same way that the dockerfile is able to reference its own code...