Skip to content

comma

comma #168

Workflow file for this run

on:
push:
paths:
- '_posts/**.md'
- '.github/workflows/related-posts.yml'
- 'script/build-related-posts'
branches:
- main
name: Build related posts
jobs:
build-related-posts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install
run: bundle install
- name: Build posts
run: bundle exec script/build-related-posts
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update related posts
title: Update related posts
add-paths: _data/related_posts.yml
delete-branch: true
token: ${{ secrets.ACTIONS_TOKEN }}
- name: Enable Pull Request Auto-merge
if: steps.create-pull-request.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.ACTIONS_TOKEN }}
pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }}
- name: Auto approve
if: steps.create-pull-request.outputs.pull-request-operation == 'created'
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }}