File tree Expand file tree Collapse file tree 3 files changed +31
-13
lines changed Expand file tree Collapse file tree 3 files changed +31
-13
lines changed Original file line number Diff line number Diff line change 1+ # Standalone workflow to update changelog if necessary
2+ name : Build changelog
3+
4+ on :
5+ workflow_dispatch :
6+
7+ jobs :
8+ changelog :
9+ needs : release
10+ uses : ./.github/workflows/reusable_publish_changelog.yml
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ name: Publish to PyPi
2020
2121# See MAINTAINERS.md "Releasing a new version" for release mechanisms
2222
23+ env :
24+ BRANCH : develop
25+
2326on :
2427 release :
2528 types : [published]
@@ -101,17 +104,14 @@ jobs:
101104 aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_VERSION --overwrite
102105 aws codepipeline start-pipeline-execution --name ${{ secrets.AWS_SAR_PIPELINE_NAME }}
103106
104- # NOTE: `event` type brings a detached head failing git setup
105- # and reusable workflows only work as a standalone job
106- # meaning we need to research for a solution that works for non-detached and detached mode
107- # changelog:
108- # needs: release
109- # permissions:
110- # contents: write
111- # uses: ./.github/workflows/reusable_publish_changelog.yml
107+ changelog :
108+ needs : release
109+ permissions :
110+ contents : write
111+ uses : ./.github/workflows/reusable_publish_changelog.yml
112112
113113 docs :
114- needs : release
114+ needs : [ release, changelog]
115115 permissions :
116116 contents : write
117117 pages : write
@@ -122,10 +122,13 @@ jobs:
122122 - uses : actions/checkout@v3
123123 with :
124124 fetch-depth : 0
125- - name : Setup git client
125+ - name : Git client setup and refresh tip
126126 run : |
127127 git config user.name "Release bot"
128- git config user.email aws-devax-open-source@amazon.com
128+ git config user.email "aws-devax-open-source@amazon.com"
129+ git config pull.rebase true
130+ git config remote.origin.url >&- || git remote add origin https://github.com/$origin # Git Detached mode (release notes) doesn't have origin
131+ git pull origin $BRANCH
129132 - name : Install poetry
130133 run : pipx install poetry
131134 - name : Set up Python
Original file line number Diff line number Diff line change 66permissions :
77 contents : write
88
9+ env :
10+ BRANCH : develop
11+
912jobs :
1013 publish_changelog :
1114 # Force Github action to run only a single job at a time (based on the group name)
@@ -23,11 +26,13 @@ jobs:
2326 git config user.name "Release bot"
2427 git config user.email "aws-devax-open-source@amazon.com"
2528 git config pull.rebase true
26- git pull --rebase
29+ git config remote.origin.url >&- || git remote add origin https://github.com/$origin # Git Detached mode (release notes) doesn't have origin
30+ git pull origin $BRANCH
2731 - name : " Generate latest changelog"
2832 run : make changelog
2933 - name : Update Changelog in trunk
3034 run : |
3135 git add CHANGELOG.md
3236 git commit -m "update changelog with latest changes"
33- git push origin HEAD:refs/heads/develop
37+ git pull origin $BRANCH # prevents concurrent branch update failing push
38+ git push origin HEAD:refs/heads/$BRANCH
You can’t perform that action at this time.
0 commit comments