2022-09-13 20:11:28 -04:00
|
|
|
|
2022-09-13 22:38:19 -04:00
|
|
|
name: Pull request workflow
|
2022-09-13 20:11:28 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [ opened, synchronize, reopened ]
|
|
|
|
branches: [ master, main ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update-readme:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
|
|
steps:
|
2022-09-13 22:07:17 -04:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-09-13 22:24:37 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
2022-09-13 22:07:17 -04:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
2022-09-13 20:11:28 -04:00
|
|
|
with:
|
|
|
|
node-version: 13
|
|
|
|
- name: Build the readme
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run build:readme
|
|
|
|
- name: Commit updates to README.md
|
|
|
|
run: |
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
git add README.md
|
|
|
|
git commit -m "chore: update README.md" || echo "No changes, skipping commit"
|
|
|
|
- name: Push changes
|
|
|
|
if: success()
|
|
|
|
uses: ad-m/github-push-action@v0.6.0
|
|
|
|
with:
|
2022-09-13 22:22:23 -04:00
|
|
|
branch: ${{ github.event.pull_request.head.ref }}
|
2022-09-13 20:11:28 -04:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-09-13 21:54:30 -04:00
|
|
|
run-danger:
|
|
|
|
runs-on: ubuntu-latest
|
2022-09-13 22:35:32 -04:00
|
|
|
needs: update-readme
|
2022-09-13 21:54:30 -04:00
|
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
|
|
steps:
|
2022-09-13 22:07:17 -04:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-09-13 22:35:32 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
2022-09-13 22:07:17 -04:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
2022-09-13 21:54:30 -04:00
|
|
|
with:
|
|
|
|
node-version: 13
|
|
|
|
- name: Set up Ruby 3.1.2
|
2022-09-13 22:07:17 -04:00
|
|
|
uses: ruby/setup-ruby@v1
|
2022-09-13 21:54:30 -04:00
|
|
|
with:
|
|
|
|
ruby-version: 3.1.2
|
|
|
|
- name: Install and run awesome_bot
|
|
|
|
# It's okay for awesome_bot to fail. Danger will post a comment on the PR if it fails.
|
|
|
|
run: |
|
|
|
|
gem install awesome_bot
|
|
|
|
awesome_bot --allow 429 --allow-redirect --allow-dupe --allow-ssl -w ipfs.io README.md || echo
|
|
|
|
- name: Run danger
|
|
|
|
run: npx --yes danger ci
|
|
|
|
env:
|
2022-09-13 22:17:58 -04:00
|
|
|
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
|