Skip to content

Commit

Permalink
ci: keep start_codebuild.sh up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstewart committed Jan 9, 2025
1 parent fd9561b commit ef4e2c6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/ci_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,41 @@ jobs:
exit 1
- name: Success
run: echo "All nix files passed format check"

validate_start_codebuild_script:
name: validate start_codebuild.sh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: pause
run: "sleep 1"
- name: retrieve statuses
id: get_statuses
uses: octokit/[email protected]
with:
route: GET /repos/{repo}/commits/{ref}/statuses?per_page=100
#repo: ${{ github.repository }}
repo: aws/s2n-tls
#ref: ${{ github.sha }}
ref: 561c145c11fc7f13d0b1de72f389997a3bd5210a
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: check start_codebuild.sh against statuses
id: github_builds
run: |
set -e
from_github=$(
jq '.[] | .description' <<< '${{ steps.get_statuses.outputs.data }}' \
| grep "for project" \
| sed -r "s/^.*?for project (.*?)\"$/\1/" \
| sort -u
)
echo builds from github statuses:
echo "$from_github"
from_file=$(
source codebuild/bin/start_codebuild.sh > /dev/null \
|| printf "%s\n" "${BUILDS[@]}" | cut -d" " -f1 | sort -u
)
echo builds from start_codebuild.sh:
echo "$from_file"
diff <(echo "$from_github") <(echo "$from_file")
4 changes: 3 additions & 1 deletion codebuild/bin/start_codebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ usage() {
echo " example: start_codebuild.sh pr/1111"
echo " example: start_codebuild.sh test_branch"
echo " example: start_codebuild.sh 1234abcd"
exit 1
}

if [ "$#" -ne "1" ]; then
usage
# Return instead of exit so we can `source` this script
# in order to get access to BUILDS.
return 1
fi
SOURCE_VERSION=$1

Expand Down

0 comments on commit ef4e2c6

Please sign in to comment.