Skip to content

Commit

Permalink
Improve pull request context.
Browse files Browse the repository at this point in the history
  • Loading branch information
DFINITYManu committed Jan 23, 2025
1 parent 667852e commit f3c49e4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/update-k8s-deployments/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ runs:
# Update the refs in the requested files.
# Refs are assumed to be named sha-[0-9a-f]+.
sed -i "s~:sha-[a-f0-9]\{40\}\$~:sha-${GITHUB_SHA}~g" $FILES_TO_UPDATE
prev_commit=$(sed -rn 's~(.+):sha-([a-f0-9]{40})~\2~p' $FILES_TO_UPDATE | head -1)
sed -rin 's~(.+):sha-([a-f0-9]{40})~\1:sha-'"${GITHUB_SHA}"'\2~p' $FILES_TO_UPDATE
# commit changes if there are any
git add .
Expand All @@ -58,6 +59,7 @@ runs:
echo "k8s_branch=$K8S_REPO_BRANCH" >> $GITHUB_OUTPUT
echo "source_branch=$SOURCE_BRANCH" >> $GITHUB_OUTPUT
echo "previous_ref=$prev_commit" >> $GITHUB_OUTPUT
- name: "Create PR to roll out with updated container images"
id: create-rollout-pr
if: ${{ steps.create-rollout-commit.outputs.k8s_branch != '' }}
Expand All @@ -67,10 +69,10 @@ runs:
github-token: ${{ inputs.push-token }}
script: |
const result = await github.rest.pulls.create({
title: '[nomrbot] - New ${{ inputs.component }} release from the dre-airflow repo',
title: '[nomrbot] - New ${{ inputs.component }} release from ${{ vars.GITHUB_REPOSITORY }}',
owner: 'dfinity-ops',
repo: 'k8s',
head: '${{ steps.create-rollout-commit.outputs.k8s_branch }}',
base: 'main',
body: 'Updating container images based on the latest changes in [this repository](https://github.com/dfinity/dre-airflow/commits/${{ steps.create-rollout-commit.outputs.source_branch }})'
body: 'Updating container images to incorporate [these changes](https://github.com/${{ vars.GITHUB_REPOSITORY }}/compare/${{ steps.create-rollout-commit.outputs.previous_ref }}..${{ steps.create-rollout-commit.outputs.source_branch }}).'
});

0 comments on commit f3c49e4

Please sign in to comment.