Skip to content

Commit 28b632a

Browse files
committed
Restore creating PRs on downstream repos
1 parent 0684346 commit 28b632a

File tree

1 file changed

+46
-66
lines changed

1 file changed

+46
-66
lines changed

.github/workflows/main.yml

Lines changed: 46 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@ jobs:
4242
with:
4343
fetch-depth: 1
4444

45-
# - name: Set up Docker Buildx
46-
# uses: docker/setup-buildx-action@v3
47-
#
48-
# - name: Build and push Docker image to ghcr.io
49-
# id: docker_build
50-
# uses: docker/build-push-action@v6
51-
# with:
52-
# context: .
53-
# no-cache: true
54-
# push: true
55-
# tags: ${{ env.IMAGE_NAME }}
56-
# build-args: |
57-
# COMMIT_SHA: ${{ github.sha }}
58-
5945
- name: Build docker image
6046
run:
6147
make image
@@ -81,12 +67,6 @@ jobs:
8167
path: ${{ env.IMAGE_TAR_FILENAME }}
8268
key: ${{ env.IMAGE_NAME }}
8369

84-
# - name: Sanitize digest
85-
# id: sanitize-digest
86-
# run: |
87-
# DIGEST=$(echo "${{ steps.docker_build.outputs.digest }}" | sed 's/^sha256://')
88-
# echo "digest=${DIGEST}" >> ${GITHUB_OUTPUT}
89-
9070
- name: Setup Kosli CLI
9171
uses: kosli-dev/setup-cli-action@v2
9272
with:
@@ -131,49 +111,49 @@ jobs:
131111
make snyk-container-scan
132112

133113

134-
# create-pr-on-downstream-repos:
135-
# needs: [setup, build-image, snyk-container-scan]
136-
# runs-on: ubuntu-latest
137-
# env:
138-
# IMAGE_NAME: ${{ needs.setup.outputs.image_name }}
139-
# BRANCH_NAME: ${{ needs.setup.outputs.branch_name }}
140-
# strategy:
141-
# matrix:
142-
# repo: [ differ, saver, dashboard, start-points-base ]
143-
# steps:
144-
# - uses: actions/checkout@v4
145-
# with:
146-
# repository: cyber-dojo/${{ matrix.repo }}
147-
# token: ${{ secrets.BASE_IMAGE_UPGRADE }}
148-
# fetch-depth: 0
149-
#
150-
# - name: Create branch
151-
# run:
152-
# git checkout -b ${BRANCH_NAME}
153-
#
154-
# - name: Edit 1st line of Dockerfile
155-
# env:
156-
# BASE_IMAGE: ${{ env.IMAGE_NAME }}@sha256:${{ needs.build-image.outputs.digest }}
157-
# run: |
158-
# cp Dockerfile Dockerfile.original
159-
# echo "FROM ${BASE_IMAGE}" > Dockerfile
160-
# cat Dockerfile.original | tail -n+2 >> Dockerfile
161-
# rm Dockerfile.original
162-
#
163-
# - name: Commit
164-
# run: |
165-
# git config --global user.name "${{ github.actor }}"
166-
# git config --global user.email "${{ github.event.sender.login }}@users.noreply.github.com"
167-
# git add .
168-
# git commit --message "Dockerfile - Automated base-image update"
169-
# git push --set-upstream origin ${BRANCH_NAME}
170-
#
171-
# - name: Create pull request
172-
# env:
173-
# GH_TOKEN: ${{ secrets.BASE_IMAGE_UPGRADE }}
174-
# run:
175-
# gh pr create
176-
# --base main
177-
# --head ${BRANCH_NAME}
178-
# --title 'Merge update-base-image into main'
179-
# --body 'Created by Github action'
114+
create-pr-on-downstream-repos:
115+
needs: [setup, build-image, snyk-container-scan]
116+
runs-on: ubuntu-latest
117+
env:
118+
IMAGE_NAME: ${{ needs.setup.outputs.image_name }}
119+
BRANCH_NAME: ${{ needs.setup.outputs.branch_name }}
120+
strategy:
121+
matrix:
122+
repo: [ differ, saver, dashboard, start-points-base ]
123+
steps:
124+
- uses: actions/checkout@v4
125+
with:
126+
repository: cyber-dojo/${{ matrix.repo }}
127+
token: ${{ secrets.BASE_IMAGE_UPGRADE }}
128+
fetch-depth: 0
129+
130+
- name: Create branch
131+
run:
132+
git checkout -b ${BRANCH_NAME}
133+
134+
- name: Edit 1st line of Dockerfile
135+
env:
136+
BASE_IMAGE: ${{ env.IMAGE_NAME }}@sha256:${{ needs.build-image.outputs.digest }}
137+
run: |
138+
cp Dockerfile Dockerfile.original
139+
echo "FROM ${BASE_IMAGE}" > Dockerfile
140+
cat Dockerfile.original | tail -n+2 >> Dockerfile
141+
rm Dockerfile.original
142+
143+
- name: Commit
144+
run: |
145+
git config --global user.name "${{ github.actor }}"
146+
git config --global user.email "${{ github.event.sender.login }}@users.noreply.github.com"
147+
git add .
148+
git commit --message "Dockerfile - Automated base-image update"
149+
git push --set-upstream origin ${BRANCH_NAME}
150+
151+
- name: Create pull request
152+
env:
153+
GH_TOKEN: ${{ secrets.BASE_IMAGE_UPGRADE }}
154+
run:
155+
gh pr create
156+
--base main
157+
--head ${BRANCH_NAME}
158+
--title 'Merge update-base-image into main'
159+
--body 'Created by Github action'

0 commit comments

Comments
 (0)