Skip to content
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
33 changes: 33 additions & 0 deletions .github/workflows/fb-post-when-pr-merged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: FB-POST
on: [push]
jobs:
FB-POST:
name: FB-POST
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Check if PR has been opened/re-opened'
id: opened
if: github.event.action == 'opened' || github.event.action == 'reopened'
run: echo "::set-output name=status::opened"
- name: 'Check if PR have been closed'
id: closed
if: github.event.action == 'closed' && github.event.pull_request.merged == false
run: echo "::set-output name=status::closed"
- name: 'Check if PR have been merged'
id: merged
if: github.event.action == 'closed' && github.event.pull_request.merged == true
run: echo "::set-output name=status::merged"
- uses: actions/checkout@master
- name: send custom message
uses: hungran/fb-post-action@main
env:
FACEBOOK_ACCESS_TOKEN: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
FACEBOOK_PAGE_ID: ${{ secrets.FACEBOOK_PAGE_ID }}
FACEBOOK_POST_MESSAGE: |
Bài Viết mới được đăng bởi **`${{ github.actor }}`** 🎉
🎉 **`${{ github.actor }}`** has been ${{join(steps.*.outputs.status, ' and ')}} a Pull Request 🍻
Repository: ${{ github.repository }}
Title: ${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}
Link: ${{ github.event.pull_request.html_url }}
Description: ${{ github.event.pull_request.body }}