Check SDK updates #132
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: Check SDK updates | |
on: | |
schedule: | |
- cron: "14 23 * * *" | |
workflow_dispatch: | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
check: | |
name: Check SDK updates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Checkout AWS SDK Go v2 | |
run: | | |
git clone --depth=1 https://github.com/aws/aws-sdk-go-v2.git | |
- name: Check SDK updates | |
id: check-sdk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_SDK_GO_V2_DIR: ./aws-sdk-go-v2 | |
run: | | |
set +e | |
make all-services.yaml | |
git diff --exit-code all-services.yaml | |
if [[ $? -eq 0 ]]; then | |
echo "No changes detected" | |
exit 0 | |
fi | |
echo "updated=true" >> "$GITHUB_OUTPUT" | |
git switch -c update-aws-sdk-go-v2-$(date +%Y%m%d-%H%M%S) | |
git add all-services.yaml | |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
git commit -m "Update all-services.yaml" | |
git push --set-upstream origin update-aws-sdk-go-v2-$(date +%Y%m%d-%H%M%S) | |
gh pr create --title "Update all-services.yaml" --body "Update all-services.yaml" --base main | |
- name: make all services | |
if: ${{ steps.check-sdk.outputs.updated == 'true' }} | |
run: | | |
cp all-services.yaml gen.yaml | |
make |