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

chore: verify lockfile on PR, commit on push to main #877

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/Lockfile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Lockfile
on:
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should remove "pull_request" here

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we separate it into two workflows, one that commits a new lockfile on push to main, and one that verifies that the PR has a correct lockfile (and could commit a new one to the source branch if the PR is this repo).

We then technically do it twice and the one that runs on pushes to main would be a safety if something would get merged without an updated lockfile.

Or skip validation of the lockfile on PRs and simply update it on every push to main?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we separate it into two workflows

yes, completely, that would be much cleaner. and the modification one would be removed once renovate will be able to update both the pom and the lockfile at the same time.

push:
branches:
- main

permissions:
contents: read
Expand All @@ -10,8 +13,18 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:
- name: run maven-lockfile
- name: run maven-lockfile - commit lockfile
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: chains-project/maven-lockfile@6572b9abec75a66b669cc6d432bdaf0ec25a92e3 # v5.0.0
with:
github-token: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
include-maven-plugins: true
commit-lockfile: true

- name: run maven-lockfile - verify lockfile
if: ${{ github.event_name == 'pull_request' }}
uses: chains-project/maven-lockfile@6572b9abec75a66b669cc6d432bdaf0ec25a92e3 # v5.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
include-maven-plugins: true
commit-lockfile: false
Loading