-
Notifications
You must be signed in to change notification settings - Fork 211
chore: add update-rpm-lockfile workflow #3342
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
nickboldt
merged 9 commits into
redhat-developer:main
from
Zaperex:add-rpm-update-workflow
Sep 15, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
15b639c
chore: add update-rpm-lockfile workflow
Zaperex 7beeae4
chore: update to include release branches
Zaperex 47c85ef
Merge branch 'main' into add-rpm-update-workflow
Zaperex 4cb4478
Merge branch 'main' into add-rpm-update-workflow
Zaperex 47aac88
Merge branch 'main' of github.com:redhat-developer/rhdh into add-rpm-…
Zaperex dc2f130
Merge branch 'main' into add-rpm-update-workflow
Zaperex c99b006
Merge branch 'main' of github.com:redhat-developer/rhdh into add-rpm-…
Zaperex 3d78ef9
chore: address suggestions
Zaperex d8ca8c5
Merge branch 'add-rpm-update-workflow' of github.com:Zaperex/rhdh int…
Zaperex 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| name: Update RPM Lockfile | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| # Run at 3AM UTC every Monday | ||
| - cron: '0 3 * * 1' | ||
| push: | ||
| branches: | ||
| - main | ||
| - release-1.** | ||
| paths: | ||
| - 'rpms.in.yaml' | ||
| - '.rhdh/docker/Dockerfile' | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| env: | ||
| DOCKERFILE_PATH: .rhdh/docker/Dockerfile | ||
| jobs: | ||
| update-lockfile: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # 4.3.0 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check if hermetic Dockerfile exists | ||
| run: | | ||
| if [ ! -f "${{ env.DOCKERFILE_PATH }}" ]; then | ||
| echo "Error: ${{ env.DOCKERFILE_PATH }} not found!" | ||
| exit 1 | ||
| fi | ||
| - name: Configure Git | ||
| run: | | ||
| git config --global user.name "rhdh-bot" | ||
| git config --global user.email "[email protected]" | ||
|
|
||
| - name: Install rpm-lockfile-prototype | ||
| run: | | ||
| if [[ ! -x "${HOME}/.local/bin/rpm-lockfile-prototype" ]]; then | ||
| echo "Installing rpm-lockfile-prototype ..." | ||
|
|
||
| sudo apt-get update | ||
| sudo apt-get install -y python3 python3-pip python3-dev build-essential | ||
| sudo apt-get install -y podman skopeo rpm | ||
| sudo apt-get install -y dnf python3-dnf | ||
|
|
||
| mkdir -p "${HOME}/.local/bin/" | ||
| python3 -m pip install --user https://github.com/konflux-ci/rpm-lockfile-prototype/archive/refs/heads/main.zip | ||
Zaperex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Update PATH | ||
| export PATH=${PATH%":${HOME}/.local/bin"}:${HOME}/.local/bin | ||
| echo "${HOME}/.local/bin" >> $GITHUB_PATH | ||
| else | ||
| echo "rpm-lockfile-prototype already installed" | ||
| fi | ||
| - name: Run rpm-lockfile-prototype | ||
| run: | | ||
| echo "Running '${HOME}/.local/bin/rpm-lockfile-prototype -f ${{ env.DOCKERFILE_PATH }} rpms.in.yaml' in $(pwd)" | ||
|
|
||
| - name: Check for lockfile changes | ||
| id: check-lockfile-changes | ||
| run: | | ||
| if git diff --quiet rpms.lock.yaml; then | ||
| echo "No changes to rpms.lock.yaml detected, skipping PR creation" | ||
| echo "changes=false" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Changes detected in rpms.lock.yaml, creating PR" | ||
| echo "changes=true" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Create Pull Request | ||
| id: create-pull-request | ||
| if: steps.check-lockfile-changes.outputs.changes == 'true' | ||
| uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| commit-message: "chore: update rpms.lock.yaml" | ||
| title: "chore: update RPM lockfile" | ||
| body: | | ||
| ## Description | ||
|
|
||
| This PR updates the `rpms.lock.yaml` file with the latest package versions based on current `rpms.in.yaml` configuration using `${{ env.DOCKERFILE_PATH }}` as the base container context | ||
|
|
||
| This PR was automatically created by the [Update RPM Lockfile GitHub Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). | ||
| branch: update-rpm-lockfile | ||
| delete-branch: true | ||
| draft: false | ||
| sign-commits: true | ||
| labels: | | ||
| lgtm | ||
| approved | ||
| add-paths: | | ||
| rpms.lock.yaml | ||
|
|
||
| - name: Summary | ||
| run: | | ||
| if [ "${{ steps.check-lockfile-changes.outputs.changes }}" == "true" ]; then | ||
| echo "✅ RPM lockfile updated and created PR: ${{ steps.create-pull-request.outputs.pull-request-url }}" | ||
| else | ||
| echo "🚫 No changes detected in RPM lockfile" | ||
| fi | ||
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.
Uh oh!
There was an error while loading. Please reload this page.