Skip to content

Commit

Permalink
Re-run PR checks after appending Change Log fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Jul 28, 2023
1 parent 87aa6fc commit 97e6e28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/777.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Re-run PR checks after appending Change Log fragment
15 changes: 15 additions & 0 deletions .github/workflows/ci-renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,36 @@ jobs:
fetch-depth: 0
# Checkout pull request HEAD commit instead of merge commit.
ref: ${{ github.event.pull_request.head.sha }}
# Needed to enable checks re-run.
token: ${{ secrets.PAT }}
- name: Set workflow variables
# Id is needed to access output in a next step.
id: vars
run: |
echo "FILE_NAME=.changelog/${{ github.event.pull_request.number }}.internal.md" >> $GITHUB_OUTPUT
- name: Check if Change Log file exists
id: check_file
run: |
if [[ ! -f "${{ steps.vars.outputs.FILE_NAME }}" ]]; then
# Change Log file does not exist, continue with other steps.
echo "FILE_EXISTS=false" >> $GITHUB_OUTPUT
else
# File exists, skip all other steps.
echo "FILE_EXISTS=true" >> $GITHUB_OUTPUT
fi
- name: Create Change Log file
if: steps.check_file.outputs.FILE_EXISTS == 'false'
run: |
echo "${{ github.event.pull_request.title }}" > ${{ steps.vars.outputs.FILE_NAME }}
- name: Commit Change Log file
if: steps.check_file.outputs.FILE_EXISTS == 'false'
run: |
# Set git user email and name to match author of the last commit.
git config --local user.email "$(git log --pretty='%ae' -1)"
git config --local user.name "$(git log --pretty=format:'%an' -1)"
git add ${{ steps.vars.outputs.FILE_NAME }}
git commit --amend --no-edit
- name: Push changes back to branch
if: steps.check_file.outputs.FILE_EXISTS == 'false'
run: |
git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }}

0 comments on commit 97e6e28

Please sign in to comment.