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

Re-rerun PR checks after appending Change Log fragment #777

Merged
merged 1 commit into from
Jul 31, 2023
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
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
25 changes: 13 additions & 12 deletions .github/workflows/ci-renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,22 @@ 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 || secrets.GITHUB_TOKEN }}
- 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: Create Change Log file
- name: Create and commit Change Log fragment if it does not exist
run: |
echo "${{ github.event.pull_request.title }}" > ${{ steps.vars.outputs.FILE_NAME }}
- name: Commit Change Log file
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
run: |
git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }}
if [[ ! -f "${{ steps.vars.outputs.FILE_NAME }}" ]]; then
buberdds marked this conversation as resolved.
Show resolved Hide resolved
echo "${{ github.event.pull_request.title }}" > ${{ steps.vars.outputs.FILE_NAME }}
# 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
git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }}
echo "FILE_EXISTS=false" >> $GITHUB_OUTPUT
fi