Skip to content

Commit 085c2e3

Browse files
authored
chore: fix workflows (#33457)
### Issue # (if applicable) n/a ### Reason for this change Checking out the `head.sha` puts us into 'detached HEAD' state ``` You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. ``` so the workflow will fail during the commit/push step: ``` Run git config --global user.name 'aws-cdk-automation' [detached HEAD 0364b3fc] chore: update analytics metadata blueprints 3 files changed, 121 insertions(+), 121 deletions(-) error: src refspec bump/2.179.0 does not match any error: failed to push some refs to 'https://github.com/aws/aws-cdk' Error: Process completed with exit code 1. ``` ### Description of changes Checkout the branch head ref just before we commit changes in the workflow. ### Describe any new or updated permissions being added n/a ### Description of how you validated changes Tested on release branch, workflow successfully [ran](https://github.com/aws/aws-cdk/actions/workflows/analytics-metadata-updater.yml). ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 0e67605 commit 085c2e3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

.github/workflows/analytics-metadata-updater.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
run: |
4848
git config --global user.name 'aws-cdk-automation'
4949
git config --global user.email '[email protected]'
50+
git checkout -B ${{ github.event.pull_request.head.ref }}
5051
git add .
5152
git commit -m "chore: update analytics metadata blueprints"
5253
git push origin ${{ github.event.pull_request.head.ref }}

.github/workflows/lambda-runtime-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
run: |
4545
git config --global user.name 'aws-cdk-automation'
4646
git config --global user.email '[email protected]'
47+
git checkout -B ${{ github.event.pull_request.head.ref }}
4748
git add .
4849
git commit -m "chore: update lambda runtime integration tests"
4950
git push origin ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)