Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@ jobs:
fi
echo "Release v${AGENT_VERSION} does not exist. Proceeding."

- name: Fetch dev branch
- name: Fetch latest remote refs
run: |
git fetch origin dev:dev
git fetch origin

- name: Create staging branch
run: |
BRANCH_NAME="v${AGENT_VERSION}-stage"
git checkout -b "$BRANCH_NAME" origin/dev
COMMIT_SHA=$(git rev-parse HEAD)
echo "Staging branch: $BRANCH_NAME at $COMMIT_SHA"
git checkout -b "$BRANCH_NAME"
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV

- name: Generate changelog
Expand Down Expand Up @@ -139,14 +137,21 @@ jobs:
git config user.email "amazon-ecs-bot@amazon.com"
git commit -m "Release ${AGENT_VERSION}"

- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Push staging branch to origin
run: |
echo "Pushing branch ${BRANCH_NAME} to origin..."
git push --force --set-upstream origin "${BRANCH_NAME}"

- name: Create pull request
env:
GH_TOKEN: ${{ secrets.ECS_AGENT_WORKFLOW_SECRET }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
PR_BODY=$(cat <<EOF
### Summary
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate-release-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ set -e
OUTPUT_FILE="CHANGELOG.md"
REPO_OWNER="aws"
REPO_NAME="amazon-ecs-agent"
BASE_BRANCH="master"
DEV_BRANCH="dev"
BASE_BRANCH="origin/master"
DEV_BRANCH="origin/dev"
AGENT_VERSION=""

# Global arrays to store changelog entries by category
Expand Down Expand Up @@ -136,7 +136,7 @@ get_release_changes() {
local commits

# Exclude merge commits using --no-merges
commits=$(git log ${BASE_BRANCH}..${DEV_BRANCH} --no-merges --format=%H 2>/dev/null)
commits=$(git log ${BASE_BRANCH}..${DEV_BRANCH} --no-merges --format=%H)

if [ $? -ne 0 ]; then
log_error "Failed to get commits. Make sure you're in a git repository and both ${BASE_BRANCH} and ${DEV_BRANCH} branches exist"
Expand Down
Loading