-
-
Notifications
You must be signed in to change notification settings - Fork 886
Use Github Action instead of renovate to update lockfile #6414
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e1e5e41
Introduce Renovate lockfile auto update github action
TimoPtr e1494e5
Delegate lockfile update to Github instead of renovate
TimoPtr ce5a187
Try to allow trigger of pr.yml
TimoPtr 2db386a
Make PR workflow dispatch-able
TimoPtr f7d356b
Trigger manually PR workflow
TimoPtr 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 hidden or 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
This file contains hidden or 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,63 @@ | ||
| name: Auto-update Renovate lockfiles | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| push: | ||
| branches: | ||
| - "renovate/**" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| jobs: | ||
| update-lockfiles: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # To push to the current branch | ||
| steps: | ||
| # Avoid re-running when this workflow just pushed a lockfile update | ||
| - name: Check if lockfiles were just updated | ||
| id: check-skip | ||
| env: | ||
| COMMIT_AUTHOR: ${{ github.event.head_commit.author.email }} | ||
| run: | | ||
| if [[ "$COMMIT_AUTHOR" == "github-actions[bot]@users.noreply.github.com" ]]; then | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| if: steps.check-skip.outputs.skip != 'true' | ||
|
|
||
| - uses: ./.github/actions/setup-build-env | ||
| if: steps.check-skip.outputs.skip != 'true' | ||
| with: | ||
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | ||
| mock-google-services: "true" | ||
|
|
||
| - name: Update lockfiles | ||
| if: steps.check-skip.outputs.skip != 'true' | ||
| run: ./gradlew alldependencies --write-locks | ||
|
|
||
| - name: Commit and push updated lockfiles | ||
| if: steps.check-skip.outputs.skip != 'true' | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add '*.lockfile' | ||
| if git diff --staged --quiet; then | ||
| echo "Lockfiles are already up to date" | ||
| else | ||
| git commit -m "Update dependency lockfiles" | ||
| git push | ||
| fi | ||
|
|
||
| - name: Trigger Workflow | ||
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | ||
| if: steps.check-skip.outputs.skip != 'true' | ||
| with: | ||
| script: | | ||
| github.rest.actions.createWorkflowDispatch({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| workflow_id: 'pr.yml', | ||
| ref: context.ref, | ||
| }) |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,14 +2,16 @@ | |
| $schema: 'https://docs.renovatebot.com/renovate-schema.json', | ||
| configMigration: true, | ||
| extends: [ | ||
| 'config:recommended', | ||
| 'config:best-practices', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A small suggestion from renovate for us to migrate to this config instead. |
||
| 'group:linters', | ||
| 'group:monorepos', | ||
| 'group:recommended', | ||
| ], | ||
| lockFileMaintenance: { | ||
| enabled: true, | ||
| }, | ||
| // Lockfile updates are handled by the renovate-lockfiles CI workflow because | ||
| // Renovate's environment lacks the Android NDK/CMake required by :microfrontend. | ||
| updateLockFiles: false, | ||
| // Allow Renovate to continue managing PRs after the CI bot commits lockfile updates. | ||
| gitIgnoredAuthors: ['github-actions[bot]@users.noreply.github.com'], | ||
| minimumReleaseAge: '3 days', | ||
| hostRules: [ | ||
| { | ||
|
|
||
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.
I think it is actually helpful to be able to manually trigger this worfklow, like for the screenshot update instead of making a dumb or empty commit.