Skip to content

Commit

Permalink
[CI] Ensure PR /fix actions push to named remote branch (#3136)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Aug 5, 2023
1 parent af0eca3 commit efb3f9e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/pr-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
env:
PR_NUM: ${{ github.event.issue.number }}
COMMENT: ${{ github.event.comment.body }}
USER_EMAIL: 107717825+opentelemetrybot@users.noreply.github.com
USER_NAME: opentelemetrybot

steps:
- name: Context info
Expand Down Expand Up @@ -49,12 +51,14 @@ jobs:
- name: Commit and push changes, if any
run: |
git config --local user.email "107717825+opentelemetrybot@users.noreply.github.com"
git config --local user.name "opentelemetrybot"
git add -A
if [[ $(git status --porcelain) ]]; then
git add -A
git config --local user.email "$USER_EMAIL"
git config --local user.name "$USER_NAME"
current_branch=$(git rev-parse --abbrev-ref HEAD)
echo current_branch=$current_branch
git commit -m 'Results from /fix:format'
git push
git push origin $current_branch
else
echo "No changes to commit"
fi
Expand Down Expand Up @@ -107,12 +111,14 @@ jobs:
- name: Commit and push changes, if any
run: |
git config --local user.email "107717825+opentelemetrybot@users.noreply.github.com"
git config --local user.name "opentelemetrybot"
git add -A
if [[ $(git status --porcelain) ]]; then
git add -A
git config --local user.email "$USER_EMAIL"
git config --local user.name "$USER_NAME"
current_branch=$(git rev-parse --abbrev-ref HEAD)
echo current_branch=$current_branch
git commit -m 'Results from /fix:recache'
git push
git push origin $current_branch
else
echo "No changes to commit"
fi
Expand Down

0 comments on commit efb3f9e

Please sign in to comment.