-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOREF] Update GHA SHA targets (#920)
* Update GHA SHA targets to use merge commit instead of head commit on branches * Add dumb sample 142 migration * Revert "Add dumb sample 142 migration" This reverts commit 120be7b. * Add script for checking migration versions * Add logging
- Loading branch information
1 parent
cd78e45
commit 4cef085
Showing
9 changed files
with
38 additions
and
98 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
type: string | ||
|
||
env: | ||
GIT_HASH: ${{ github.event.pull_request.head.sha || github.sha }} | ||
GIT_HASH: ${{ github.sha }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
ENV: ${{ inputs.env }} | ||
|
||
|
@@ -34,8 +34,6 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GIT_HASH }} | ||
- name: Configure AWS credentials | ||
uses: aws-actions/[email protected] | ||
with: | ||
|
@@ -85,8 +83,6 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GIT_HASH }} | ||
- name: Configure AWS credentials | ||
uses: aws-actions/[email protected] | ||
with: | ||
|
@@ -134,8 +130,6 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GIT_HASH }} | ||
- name: Configure AWS credentials | ||
uses: aws-actions/[email protected] | ||
with: | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
env: | ||
AWS_DEFAULT_REGION: us-west-2 | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
GIT_HASH: ${{ github.event.pull_request.head.sha || github.sha }} | ||
GIT_HASH: ${{ github.sha }} | ||
|
||
jobs: | ||
rescan_deployed_image: | ||
|
@@ -16,8 +16,6 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GIT_HASH }} | ||
- name: Configure AWS credentials | ||
uses: aws-actions/[email protected] | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
# | ||
|
||
set -eu -o pipefail | ||
|
||
# Parent path magic to always set the correct relative paths when running this script | ||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P ) | ||
cd "$parent_path" || exit | ||
|
||
# shellcheck disable=SC2012 | ||
migration_versions=$(ls -1 ../migrations/ | sed 's/__.*$//' | sort -V) | ||
migration_versions_unique=$(echo "$migration_versions" | uniq) | ||
|
||
count_of_migrations=$(echo "$migration_versions" | wc -l) | ||
count_of_uniq_migrations=$(echo "$migration_versions_unique" | wc -l) | ||
|
||
# Print out results | ||
echo "Detected $count_of_migrations migrations." | ||
echo "Detected $count_of_uniq_migrations unique migrations." | ||
|
||
# If the number of migrations is not equal to the number of unique migrations, | ||
# then there are duplicate migrations. | ||
if [ "$count_of_migrations" -ne "$count_of_uniq_migrations" ]; then | ||
echo "Duplicate migrations detected. Please remove the duplicate migrations." | ||
echo "The following migrations are duplicated:" | ||
echo "$migration_versions" | uniq -d | ||
exit 1 | ||
fi |