Skip to content

Commit 936ed22

Browse files
committed
Add current job run url to PRs to network-operator
Signed-off-by: Alexander Maslennikov <[email protected]>
1 parent 45c7792 commit 936ed22

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/fork-ci-reusable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,5 @@ jobs:
222222
--base $BASE_BRANCH \
223223
--head $(git branch --show-current) \
224224
--title "$COMMIT_MESSAGE" \
225-
--body "Created by the *${{ github.job }}* job."
225+
--body "Created by the *${{ github.job }}* job: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
226226
fi

.github/workflows/test-fork-ci-callee.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,20 @@ jobs:
112112
ref: ${{ needs.validate-pr-with-updated-version-open.outputs.head-ref-name }}
113113
- name: Verify version changes in PR
114114
env:
115+
GH_TOKEN: ${{ github.token }}
115116
DOCKER_TAG: ${{ needs.call-reusable-ci-fork-workflow.outputs.docker-tag }}
116-
# TODO make react on public and internal registries if needed
117+
PR_NUMBER: ${{ needs.validate-pr-with-updated-version-open.outputs.pr-number }}
117118
DOCKER_REGISTRY: ghcr.io/mellanox
118119
RELEASE_FILE: hack/release.yaml
119120
run: |
121+
echo "Validating that PR description contains the current workflow run url..."
122+
CURRENT_RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
123+
PR_BODY=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json body -q '.body')
124+
if ! echo "$PR_BODY" | grep -Fq "$CURRENT_RUN_URL"; then
125+
echo "Error: PR body does not contain the current workflow run URL ($CURRENT_RUN_URL)" >&2
126+
exit 1
127+
fi
128+
120129
make check-release-build
121130
122131
echo "Validating changes in release.yaml..."

0 commit comments

Comments
 (0)