Stephen/updated baseline2 #76
This file contains hidden or 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: Check for manual deployment requirements | |
on: | |
# Run on any pull request into the trunk branch | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- staging | |
jobs: | |
check-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check for file changes that must be deployed manually | |
id: check_files | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const prFiles = await github.rest.pulls.listFiles({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.issue.number | |
}); | |
const dmsTasksModified = prFiles.data.some(file => file.filename === 'aws/dms/tasks.yml'); | |
if (dmsTasksModified) { | |
const dmsPrefix = "[WARN: DMS Config Modified]"; | |
const comments = await github.rest.issues.listComments({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number | |
}); | |
const commentExists = comments.data.some(comment => comment.body.includes(dmsPrefix)); | |
if (!commentExists) { | |
await github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: dmsPrefix + " This PR modifies the `aws/dms/tasks.yml` file. These changes must be deployed manually by @code-dot-org/infrastructure before merging." | |
}); | |
} | |
} |