Merge pull request #772 from benbalter/lint #177
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
paths: | |
- '_posts/**.md' | |
- '.github/workflows/related-posts.yml' | |
- 'script/build-related-posts' | |
branches: | |
- main | |
name: Build related posts | |
permissions: | |
contents: write | |
statuses: write | |
jobs: | |
build-related-posts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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@v6 | |
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 }} |