Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebTheWizard committed Apr 11, 2020
2 parents e13e32b + c79a51b commit 3aa65e0
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# discord-commits
# Discord Action Commits
GitHub Action for Discord that prints commit messages based on templates.


## Example Appearence:

![Imgur](https://imgur.com/YvLWWGL.jpg)


<hr/>

## Example Usage

```yaml
- name: Send message to discord
uses: Sniddl/discord-action@master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message: "Successful commit to **{{ github.context.payload.repository.owner.name }}/{{ github.context.payload.repository.name}}**.\nDiff: {{ github.context.payload.compare }}"
embed: '{ "title": "{{ commit.title }}", "description": "{{ commit.description }}", "url": "{{ commit.url }}", "author": { "name": "{{ commit.author.name }} ({{ commit.author.username }})", "icon_url": "https://avatars.io/gravatar/{{ commit.author.email }}"} }'
```
## Variables
All variables available through GitHub such as payloads and commits can be accessed via `{{ github }}`. As an example, the repository name can be accessed by `{{ github.context.payload.repository.name }}`

Environment variables can be accessed by `{{ env }}`. Example, `{{ env.mycustomdata.somepath }}`

Commits are automatically looped over at displayed as embed objects. The data for each commit is scoped under `{{ commit }}` in the `embed` input template. Example, commmit author name is `{{ commit.author.name }}`


0 comments on commit 3aa65e0

Please sign in to comment.