Skip to content

Commit

Permalink
Test2
Browse files Browse the repository at this point in the history
  • Loading branch information
cPu1 committed Aug 21, 2023
1 parent b55359d commit 42f599d
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release-merge2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Merge release changes to main
workflow_dispatch: {}
env:
VERSION_FILE: pkg/version/release.go
DEFAULT_BRANCH: main
jobs:
merge_release:
name: Merge release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
with:
fetch-depth: 0
- name: Setup identity as eksctl-bot
uses: ./.github/actions/setup-identity
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge release branch into ${{env.DEFAULT_BRANCH}}
run: |
git checkout $DEFAULT_BRANCH
git checkout -b merge-${{ github.sha }}
if [ "$(git merge --no-commit --no-ff ${{ github.ref }})" = "Already up to date." ]; then
echo "Exiting";
exit 0;
fi
git checkout ORIG_HEAD -- $VERSION_FILE
git add $VERSION_FILE
EDITOR=true git merge --continue
! git diff --exit-code $DEFAULT_BRANCH...HEAD || exit 1
git push --set-upstream origin HEAD
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6.4.1
name: Open PR to ${{env.DEFAULT_BRANCH}}
with:
github-token: ${{ secrets.EKSCTLBOT_TOKEN }}
script: |
const { data: pr } = await github.pulls.create({
...context.repo,
title: `Merge ${context.ref} to ${{ env.DEFAULT_BRANCH }}`,
head: `merge-${context.sha}`,
base: "${{ env.DEFAULT_BRANCH }}",
});
await github.issues.addLabels({
...context.repo,
issue_number: pr.number,
labels: ["skip-release-notes"],
});

0 comments on commit 42f599d

Please sign in to comment.