Skip to content

Commit

Permalink
Fix create PR action
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nimalank7 committed Nov 21, 2023
1 parent d57f4b0 commit 5eed68f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
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

0 comments on commit 5eed68f

Please sign in to comment.