Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pull request descrcription if exists. #82

Merged
merged 2 commits into from
Jan 23, 2025
Merged
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
34 changes: 26 additions & 8 deletions .github/workflows/update-k8s-deployments/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,30 @@ runs:
with:
github-token: ${{ inputs.push-token }}
script: |
const result = await github.rest.pulls.create({
title: '[nomrbot] - New ${{ inputs.component }} release from ${{ github.repository }}',
owner: 'dfinity-ops',
repo: 'k8s',
head: '${{ steps.create-rollout-commit.outputs.k8s_branch }}',
base: 'main',
maintainer_can_modify: true,
body: 'Updating container images to incorporate [these changes](https://github.com/${{ github.repository }}/compare/${{ steps.create-rollout-commit.outputs.previous_ref }}..${{ steps.create-rollout-commit.outputs.current_ref }}).'
const owner = 'dfinity-ops';
const repo = 'k8s';
const base = 'main';
const pulls = await github.rest.pulls.list({
owner: owner,
repo: repo,
base: base,
head: '${{ steps.create-rollout-commit.outputs.k8s_branch }}'
});
if (pulls.length > 0) {
const result = await github.rest.pulls.update({
owner: owner,
repo: repo,
pull_number: pulls[0]["number"],
body: 'Updating container images to incorporate [these changes](https://github.com/${{ github.repository }}/compare/${{ steps.create-rollout-commit.outputs.previous_ref }}..${{ steps.create-rollout-commit.outputs.current_ref }}).',
});
} else {
const result = await github.rest.pulls.create({
title: '[nomrbot] - New ${{ inputs.component }} release from ${{ github.repository }}',
owner: owner,
repo: repo,
head: '${{ steps.create-rollout-commit.outputs.k8s_branch }}',
base: base,
maintainer_can_modify: true,
body: 'Updating container images to incorporate [these changes](https://github.com/${{ github.repository }}/compare/${{ steps.create-rollout-commit.outputs.previous_ref }}..${{ steps.create-rollout-commit.outputs.current_ref }}).'
});
}
Loading