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

Created pushmsg.yml #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/pushmsg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Changes Received

on:
push:
branches:
- vampbrain-patch-1

jobs:
my-job:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Get pusher's name and commit message
id: commit_info
run: |
USER=$(git log -1 --pretty=format:'%an')
MESSAGE=$(git log -1 --pretty=format:'%s')
echo "::set-output name=user::$USER"
echo "::set-output name=message::$MESSAGE"

- name: Append to README
run: |
USER=${{ steps.commit_info.outputs.user }}
MESSAGE=${{ steps.commit_info.outputs.message }}
echo "Pushed by: $USER" >> README.md
echo "Commit Message: $MESSAGE" >> README.md

- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add README.md
git commit -m "Add pusher's name and commit message"
git push