Skip to content

Instantly share code, notes, and snippets.

@bdougie
Last active March 27, 2024 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdougie/c31ea9f59d9d049a732a046be017eb28 to your computer and use it in GitHub Desktop.
Save bdougie/c31ea9f59d9d049a732a046be017eb28 to your computer and use it in GitHub Desktop.
name: Sign off commits in UI
on:
pull_request:
paths:
- '*.md'
jobs:
sign-off-commit:
name: signing commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Sign the last commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout "${GITHUB_HEAD_REF}"
git config --global user.name ${GITHUB_ACTOR}
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git add .
git commit --amend --no-edit --signoff
git push -u origin ${GITHUB_HEAD_REF} -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment