Skip to content

Commit 353de8c

Browse files
committed
Bug fixes
Fixed docs/docs directory path failure. We need to go from docs/dashboards upwards two levels, so replaced with `cd ../..`. Fixed a potential issue with CODEOWNERS file being empty. We check for its existence and only add the option if the file exists.
1 parent 55ef109 commit 353de8c

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/publish_docs_update.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ jobs:
3333
id: get-reviewers
3434
working-directory: target-repo
3535
run: |
36-
REVIEWERS=$(grep "${SUBMODULE_PATH}" .github/CODEOWNERS \
37-
| awk '{for(i=2;i<=NF;i++) print substr($i,2)}' \
38-
| paste -sd "," -)
36+
REVIEWERS=""
37+
if [[ -f .github/CODEOWNERS ]]; then
38+
REVIEWERS=$(grep "${SUBMODULE_PATH}" .github/CODEOWNERS \
39+
| awk '{for(i=2;i<=NF;i++) print substr($i,2)}' \
40+
| paste -sd "," -)
41+
fi
3942
4043
echo "REVIEWERS=${REVIEWERS}" >> "$GITHUB_OUTPUT"
4144
@@ -59,7 +62,7 @@ jobs:
5962
cd "${SUBMODULE_PATH}"
6063
git fetch origin
6164
git checkout ${{ github.sha }}
62-
cd ..
65+
cd ../..
6366
git add "${SUBMODULE_PATH}"
6467
6568
- name: Commit changes
@@ -85,11 +88,16 @@ jobs:
8588
run: |
8689
BODY="Automated update of the OpenSearch Dashboards docs submodule to commit [\`${{ github.sha }}\`](https://github.com/canonical/opensearch-dashboards-operator/commit/${{ github.sha }})."
8790
91+
REVIEWER_FLAG=""
92+
if [[ -n "${{ steps.get-reviewers.outputs.REVIEWERS }}" ]]; then
93+
REVIEWER_FLAG="--reviewer ${{ steps.get-reviewers.outputs.REVIEWERS }}"
94+
fi
95+
8896
PR_URL=$(gh pr create \
8997
--title "chore: Update OpenSearch Dashboards docs submodule" \
9098
--body "${BODY}" \
9199
--base "${{ env.BASE_BRANCH }}" \
92100
--head "${PR_BRANCH}" \
93-
--reviewer "${{ steps.get-reviewers.outputs.REVIEWERS }}"
101+
${REVIEWER_FLAG}
94102
)
95103
echo "- ${PR_URL}" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)