chore(deps): update actions/dependency-review-action action to v4.5.0 #188
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sanity Checks | |
on: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
verify: | |
name: Check whether .devcontainer.json files are updated | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the source code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Check changed files | |
run: | | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
base="${{ github.event.pull_request.base.sha }}" | |
head="${{ github.event.pull_request.head.sha }}" | |
else | |
base="${{ github.event.before }}" | |
head="${{ github.event.after }}" | |
fi | |
for image in images/src/*; do | |
changes="$(git diff --name-only "${base}" "${head}" -- "${image}" | grep -Fv "${image}/README.md" || true)" | |
if [ -n "${changes}" ] && ! echo "${changes}" | grep -q "${image}/.devcontainer.json"; then | |
echo "::error::Changes were made to ${image}, but the corresponding .devcontainer.json was not updated" | |
exit 1 | |
fi | |
done |