From 5eed68f41052cee585266027d2e80c68fc377128 Mon Sep 17 00:00:00 2001 From: nimalank7 Date: Tue, 21 Nov 2023 14:56:25 +0000 Subject: [PATCH] Fix create PR action Description: - Fixes the create-pr action by providing the correct path for create-pr.sh - Only one app in directory so can remove the iterator --- .github/workflows/create-pr.yaml | 4 ++-- docker/create-pr.sh | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/create-pr.yaml b/.github/workflows/create-pr.yaml index ed4856aa..2fc18a7f 100644 --- a/.github/workflows/create-pr.yaml +++ b/.github/workflows/create-pr.yaml @@ -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 }} diff --git a/docker/create-pr.sh b/docker/create-pr.sh index a71d7710..9a45d276 100644 --- a/docker/create-pr.sh +++ b/docker/create-pr.sh @@ -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 )