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 todo-to-list github action to commit to PR instead of master branch #2943

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
18 changes: 10 additions & 8 deletions .github/workflows/todo-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@

name: "Run TODO to Issue"
on:
push:
branches:
- replace-with-master-when-fixed
pull_request_review:
types:
- submitted

jobs:
build:
run-on-approval:
if: ${{ github.event.review.state == 'approved' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
ref: ${{ github.head_ref }}
- name: "TODO to Issue"
uses: alstr/[email protected]
with:
Expand All @@ -35,14 +37,14 @@ jobs:
CLOSE_ISSUES: "true"
- name: Set Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name ${{ github.actor }}
git config --global user.email `git log -n 1 --pretty=format:%ae remotes/origin/${{ github.head_ref }}`
- name: Commit and Push Changes
run: |
git add -A
if [[ `git status --porcelain` ]]; then
git commit -m "Automatically added GitHub issue links to TODOs"
git push origin master
git push origin ${{ github.head_ref }}
else
echo "No changes to commit"
fi
Loading