Skip to content

Commit b36dea7

Browse files
committed
chore(ci): changelog to use new create-pr action
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
1 parent defe5e7 commit b36dea7

File tree

2 files changed

+10
-136
lines changed

2 files changed

+10
-136
lines changed

.github/scripts/create_pr_for_staged_changes.sh

Lines changed: 0 additions & 116 deletions
This file was deleted.

.github/workflows/reusable_publish_changelog.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
workflow_call:
55

66
env:
7-
BRANCH: develop
7+
TEMP_BRANCH_PREFIX: "ci-changelog"
8+
PULL_REQUEST_TITLE: "chore(ci): changelog rebuild"
9+
FILES_TO_COMMIT: "CHANGELOG.md"
810

911
jobs:
1012
publish_changelog:
@@ -21,25 +23,13 @@ jobs:
2123
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2224
with:
2325
fetch-depth: 0
24-
- name: Git client setup and refresh tip
25-
run: |
26-
git config user.name "Release bot"
27-
git config user.email "aws-devax-open-source@amazon.com"
28-
git config pull.rebase true
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}"
3126
- name: "Generate latest changelog"
3227
run: make changelog
3328
- name: Create PR
34-
run: bash .github/scripts/create_pr_for_staged_changes.sh CHANGELOG.md
35-
env:
36-
COMMIT_MSG: "chore(ci): update changelog with latest changes"
37-
PR_TITLE: "chore(ci): changelog rebuild"
38-
TEMP_BRANCH_PREFIX: "ci-changelog"
39-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
- name: Cleanup orphaned branch
41-
if: failure()
42-
run: git push origin --delete "${TEMP_BRANCH_PREFIX}-${GITHUB_RUN_ID}" || echo "Must have failed before creating temporary branch; no cleanup needed."
43-
env:
44-
TEMP_BRANCH_PREFIX: "ci-changelog"
45-
GITHUB_RUN_ID: ${{ github.run_id }}
29+
id: create-pr
30+
uses: ./.github/actions/create-pr
31+
with:
32+
files: ${{ env.FILES_TO_COMMIT }}
33+
temp_branch_prefix: ${{ env.TEMP_BRANCH_PREFIX }}
34+
pull_request_title: ${{ env.PULL_REQUEST_TITLE }}
35+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)