-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add simple 'checks' workflow for PR and Merge events #10
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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,57 @@ | ||
name: Checks | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
status: ${{ job.status }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name : Run EC Validate (keyless) | ||
uses: ./ | ||
with: | ||
image: ghcr.io/enterprise-contract/golden-container:latest | ||
identity: https:\/\/github\.com\/(slsa-framework\/slsa-github-generator|enterprise-contract\/golden-container)\/ | ||
issuer: https://token.actions.githubusercontent.com | ||
|
||
#FIXME Commented out because the golden-image on quay.io is failing due to a violation in the image. | ||
# - name : Run EC Validate (Long_Lived) | ||
# uses: ./ | ||
# with: | ||
# image: quay.io/redhat-appstudio/ec-golden-image:latest | ||
# key: ${{ vars.PUBLIC_KEY }} | ||
# policy: github.com/enterprise-contract/config//slsa3 | ||
# extra-params: --ignore-rekor | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
if: needs.ci.outputs.status == 'success' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | ||
steps: | ||
- name: Get Latest Version Tag and Increment | ||
run: | | ||
# Find the version tag and then increment new version with v prefix eg. v1.0.1 -> v1.0.2 | ||
latestVTag=$(gh api -H 'Accept: application/vnd.github.v3+json' /repos/${{ github.repository }}/releases/latest -q '.tag_name') | ||
echo "newVersion=v$(echo ${latestVTag#v} | awk -F. '{$NF = $NF + 1;} 1' OFS=.)" >> $GITHUB_ENV | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Create New Version Release | ||
seanconroy2021 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ env.newVersion }} Release | ||
body: "" | ||
tag_name: ${{ env.newVersion }} | ||
generate_release_notes: true | ||
draft: false | ||
prerelease: false |
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
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.
Let's explain more clearly in comments why this is commented out.
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.
Done hopefully more clear now 👍🏻
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.
I wonder if this change fixed it: enterprise-contract/golden-container#129
As a side note. Usually, a comment like this would go as the first line of the commented out block so it is obvious to the reader, e.g.:
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.
It is now a warning I am going try fix it. I think we will leave it commented out for time being