-
Notifications
You must be signed in to change notification settings - Fork 13
Add API changelog check workflow #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| - name: Checkout repository | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | ||
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| fetch-depth: 0 | |
| fetch-depth: 0 | |
| persist-credentials: false |
Suggestion 1 from zizmor -
This is for removing the git credentials after the git checkout. It prevents later steps from maliciously sending/using the credentials.
| - name: Get changed model files | ||
| id: changed-models | ||
| run: | | ||
| changed_models=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'codegen/aws-models/*.json' | xargs -I {} basename {} .json) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| changed_models=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'codegen/aws-models/*.json' | xargs -I {} basename {} .json) | |
| changed_models=$(git diff --name-only origin/${GITHUB_BASE_REF}...HEAD -- 'codegen/aws-models/*.json' | xargs -I {} basename {} .json) |
Suggestion 2 from zizmor -
Again, not a major concern since running PRs from untrusted actors is turned off by default, but better safe than sorry.
This uses the builtin GitHub environment variable of GITHUB_BASE_REF to prevent malicious branch names from being executed. Example CVE.
| exit 1 | ||
| fi | ||
|
|
||
| echo "All modified models have corresponding changelog entries." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| echo "All modified models have corresponding changelog entries." | |
| echo "All modified models have corresponding changelog entries." | |
| env: | |
| STEPS_CHANGED_MODELS_OUTPUTS_MODELS: ${{ steps.changed-models.outputs.models }} |
Continuation of the above
| if [ "$valid_entry_found" = false ]; then | ||
| missing_changelogs="${missing_changelogs}\n - ${service} (no valid changelog entry in ${changelog_dir})" | ||
| fi | ||
| done <<< "${{ steps.changed-models.outputs.models }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| done <<< "${{ steps.changed-models.outputs.models }}" | |
| done <<< "${STEPS_CHANGED_MODELS_OUTPUTS_MODELS}" |
Same as above comment
|
Looks good over all - added some suggestions from Zizmor, which we should add to this repo to run over all GH actions to run by default in the long run. |
Summary
Add a GitHub Actions workflow to ensure changelog entries are added when manually updating AWS models. When a PR modifies files in
codegen/aws-models/, this workflow verifies that a corresponding changelog entry exists inclients/aws-sdk-<service>/.changes/next-release/.Workflow Behavior
modifies codegen/aws-models/*.jsonskip-changeloglabel presentValidation Requirements
A valid changelog entry must:
"type": "api-change"and a"description"fieldTest plan
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.