1
0
Fork 0
mirror of https://github.com/ipfs/awesome-ipfs.git synced 2024-11-20 11:28:35 -05:00
ipfs/.github/workflows/pull_requests.yml

80 lines
2.4 KiB
YAML

name: Pull request workflow
on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ master, main ]
jobs:
# Run linting and tests
build-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: 13
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: |
README.md
build: |
npm run build:readme
cache_name: readme
# aegir/actions/cache-node-modules runs build. We don't need to run it again.
- run: npm run lint
update-readme:
runs-on: ubuntu-latest
needs: build-and-lint
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 13
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: |
README.md
build: |
npm run build:readme
cache_name: readme
- name: Commit updates to README.md
run: |
git config --local user.email "108953096+ipfs-gui-bot@users.noreply.github.com"
git config --local user.name "ipfs-gui-bot"
git add README.md
git commit -m "chore: update README.md" && git push || echo "No changes, skipping commit"
run-danger:
runs-on: ubuntu-latest
needs: update-readme
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 13
- name: Set up Ruby 3.1.2
uses: ruby/setup-ruby@v1
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:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}