forked from jenkins-docs/quickstart-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix docker version #473
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
Closed
Closed
Fix docker version #473
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f73e04c
fix: ensures the PR will only contain changes to docker-versions.txt …
gounthar 8ef04ff
Apply suggestions from code review
gounthar dcb9592
fix: improve Dockerfile change detection in CI workflow
gounthar 877bb35
fix: update GitHub Actions to skip Docker builds for forked repositories
gounthar 4da3074
fix: update GitHub Actions to skip Docker builds for forked repositories
gounthar d7916fa
fix: update Docker build platforms to support arm64 architecture
gounthar 464d27b
Merge remote-tracking branch 'origin/fix-docker-version' into fix-doc…
gounthar f5bdbb9
fix: update Docker build conditions to check for directory paths
gounthar d1efff5
fix: add check for existing PR before creating Docker version update PR
gounthar d9954fa
fix: remove backticks from Docker version update message
gounthar 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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
|
|
@@ -35,12 +35,6 @@ jobs: | |
| id: changes | ||
| run: echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_ENV | ||
|
|
||
| - name: Write Docker versions to file | ||
| # This step writes the Docker and Docker Compose versions to a file | ||
| run: | | ||
| echo "- $(docker --version)" > docker-versions.txt | ||
| echo "- $(docker compose version)" >> docker-versions.txt | ||
|
|
||
| - name: Authenticate GH CLI | ||
| # This step authenticates the GitHub CLI | ||
| run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" | ||
|
|
@@ -50,14 +44,35 @@ jobs: | |
| run: | | ||
| git config --global user.name 'GitHub Action' | ||
| git config --global user.email '[email protected]' | ||
| git checkout -b docker-versions-update | ||
|
|
||
| # Ensure we start from a clean main branch | ||
| git fetch origin main | ||
| git checkout main | ||
| git reset --hard origin/main | ||
|
|
||
| # Create unique branch name to avoid conflicts | ||
| BRANCH_NAME="docker-versions-update-$(date +%s)" | ||
| git checkout -b "$BRANCH_NAME" | ||
|
|
||
| # Write Docker versions to file | ||
| echo "- $(docker --version)" > docker-versions.txt | ||
| echo "- $(docker compose version)" >> docker-versions.txt | ||
|
|
||
| # Only add the specific file we want | ||
| git add docker-versions.txt | ||
| if git diff-index --quiet HEAD --; then | ||
| echo "No changes to commit" | ||
|
|
||
| # Check if there are actually changes to commit | ||
| if git diff --cached --quiet; then | ||
| echo "No changes to docker-versions.txt, skipping PR creation" | ||
| else | ||
| git commit -m "Update Docker versions" | ||
| git push origin docker-versions-update | ||
| echo 'y' | gh pr create --fill | ||
| git commit -m "chore: update Docker versions | ||
| git push origin "$BRANCH_NAME" | ||
| # Create PR with explicit title and body instead of --fill | ||
| gh pr create \ | ||
| --title "chore: update Docker versions" \ | ||
| --body "Automated update of docker-versions.txt with current Docker and Docker Compose versions. | ||
| --base main \ | ||
| --head "$BRANCH_NAME" | ||
| fi | ||
|
|
||
| - name: Check for Dockerfile and context changes | ||
|
|
||
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.