Enhance sync with upstream and push for almalinux/docker-library-official-images (#6)
- use GitHub CLI to sync - pull with '--rebase --autostash' before push Update README.md
This commit is contained in:
parent
926f2d68e6
commit
1595870d6c
32
.github/workflows/publish-docker-library.yml
vendored
32
.github/workflows/publish-docker-library.yml
vendored
@ -108,6 +108,14 @@ jobs:
|
|||||||
- prepare-definitions
|
- prepare-definitions
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
-
|
||||||
|
name: "Sync ${{ env.local_library }} with ${{ env.docker_library }}, branch 'master'"
|
||||||
|
run: |
|
||||||
|
# Sync ${{ env.local_library }} with ${{ env.docker_library }}, branch 'master'
|
||||||
|
|
||||||
|
gh auth login --with-token < <(echo ${{ secrets.GIT_HUB_TOKEN }})
|
||||||
|
gh repo sync ${{ env.local_library }} --force --source ${{ env.docker_library }} --branch master
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Checkout ${{ env.local_library }}, branch 'master'
|
name: Checkout ${{ env.local_library }}, branch 'master'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -117,27 +125,6 @@ jobs:
|
|||||||
token: ${{ secrets.GIT_HUB_TOKEN }}
|
token: ${{ secrets.GIT_HUB_TOKEN }}
|
||||||
fetch-depth: 0 # Checkout all commits
|
fetch-depth: 0 # Checkout all commits
|
||||||
|
|
||||||
-
|
|
||||||
name: "Sync ${{ env.local_library }} with ${{ env.docker_library }}"
|
|
||||||
run: |
|
|
||||||
# sync ${{ env.local_library }}
|
|
||||||
cd official-images
|
|
||||||
|
|
||||||
git remote add upstream https://github.com/${{ env.docker_library }}.git
|
|
||||||
git fetch upstream
|
|
||||||
git checkout master
|
|
||||||
|
|
||||||
ret=0
|
|
||||||
git rebase upstream/master || ret=$?
|
|
||||||
|
|
||||||
if [ $ret -ne 0 ]; then
|
|
||||||
echo "Abort the rebase, reset last commit, stash it and try to rebase again ..."
|
|
||||||
git rebase --abort
|
|
||||||
git reset HEAD~1
|
|
||||||
git stash
|
|
||||||
git rebase upstream/master
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download uploaded above 'official-images/library/almalinux.*'
|
# Download uploaded above 'official-images/library/almalinux.*'
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
name: Download all definitions
|
name: Download all definitions
|
||||||
@ -194,7 +181,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cwd: official-images
|
cwd: official-images
|
||||||
default_author: user_info
|
default_author: user_info
|
||||||
message: "Almalinux auto-update - ${{ env.date_stamp }} ${{ env.time_stamp }}"
|
pull: '--rebase --autostash'
|
||||||
|
message: "AlmaLinux auto-update - ${{ env.date_stamp }} ${{ env.time_stamp }}"
|
||||||
push: true
|
push: true
|
||||||
|
|
||||||
-
|
-
|
||||||
|
@ -660,7 +660,7 @@ Publish images to the Docker Library
|
|||||||
└── Create Pull Request with the new definition file
|
└── Create Pull Request with the new definition file
|
||||||
├── Set up job
|
├── Set up job
|
||||||
├── Checkout official-images, branch 'master'
|
├── Checkout official-images, branch 'master'
|
||||||
├── Sync official-images with docker-library/official-images
|
├── Sync official-images with docker-library/official-images, branch 'master'
|
||||||
├── Download all definitions
|
├── Download all definitions
|
||||||
├── Create head of official-images/library/almalinux
|
├── Create head of official-images/library/almalinux
|
||||||
├── Merge definitions into official-images/library/almalinux
|
├── Merge definitions into official-images/library/almalinux
|
||||||
@ -721,7 +721,7 @@ That's your fork of [docker-library/official-images](https://github.com/docker-l
|
|||||||
|
|
||||||
#### Step: Sync *official-images* with upstream
|
#### Step: Sync *official-images* with upstream
|
||||||
|
|
||||||
The step is written in bash. It adds the [official-images upstream](https://github.com/docker-library/official-images) repository, sets a local 'master' branch to track the corresponding one from the upstream, and tries to rebase with the 'upstream/master'.
|
The step is written in bash. It uses GitHub CLI to sync the [docker-library-official-images](https://github.com/AlmaLinux/docker-library-official-images) with the [official-images upstream](https://github.com/docker-library/official-images) repository.
|
||||||
|
|
||||||
#### Step: Download all definitions
|
#### Step: Download all definitions
|
||||||
|
|
||||||
@ -749,8 +749,9 @@ Uses [EndBug/add-and-commit@v9](https://github.com/marketplace/actions/add-commi
|
|||||||
|
|
||||||
The commit message is:
|
The commit message is:
|
||||||
```yaml
|
```yaml
|
||||||
Almalinux auto-update - ${{ env.date_stamp }} ${{ env.time_stamp }}.
|
AlmaLinux auto-update - ${{ env.date_stamp }} ${{ env.time_stamp }}.
|
||||||
```
|
```
|
||||||
|
> It will try to pull recent changes (before push) with `--rebase --autostash`
|
||||||
|
|
||||||
#### Step: Create Pull Request for *official-images/library/almalinux*
|
#### Step: Create Pull Request for *official-images/library/almalinux*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user