Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Fix create PR action #1213

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/create-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
uses: actions/checkout@v4
with:
repository: alphagov/datagovuk_publish
path: ckanext
- run: bash ./docker/create-pr.sh
- name: Create PR
run: bash ./docker/create-pr.sh
env:
GH_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }}
GH_REF: ${{ github.ref_name }}
Expand Down
12 changes: 5 additions & 7 deletions docker/create-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ for ENV in $(echo $ENVS | tr "," " "); do
git checkout -b ${BRANCH}

cd "${ENV}"
for APP in ckan pycsw solr; do
yq -i '.tag = env(IMAGE_TAG)' "${APP}.yaml"
yq -i '.branch = env(SOURCE_BRANCH)' "${APP}.yaml"
git add "${APP}.yaml"
done
yq -i '.tag = env(IMAGE_TAG)' "publish.yaml"
yq -i '.branch = env(SOURCE_BRANCH)' "publish.yaml"
git add "publish.yaml"

if [[ $(git status | grep "nothing to commit") ]]; then
echo "Nothing to commit"
else
git commit -m "Update image tags for ${ENV} to ${IMAGE_TAG}"
git commit -m "Update datagovuk_publish image tags for ${ENV} to ${IMAGE_TAG}"
git push --set-upstream origin "${BRANCH}"
gh pr create --title "Update image tags for ${ENV} (${IMAGE_TAG})" --base main --head "${BRANCH}" --fill
gh pr create --title "Update datagovuk_publish image tags for ${ENV} (${IMAGE_TAG})" --base main --head "${BRANCH}" --fill
fi
fi
)
Expand Down
Loading