Skip to content

Scoping Feature

Scoping Feature #62

Workflow file for this run

name: public-api
on:
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: check API 🌐
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Install nightly & cargo-public-api
run: |
set -euxo pipefail
rustup install nightly-2024-10-11 --profile minimal
mv ~/.rustup/toolchains/nightly-2024-10-11-x86_64-unknown-linux-gnu ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu
- name: Install public-api
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-public-api
locked: true
- name: Checkout
uses: actions/checkout@v4
- name: Check API
run: |
echo "Commit: ${{ github.event.pull_request.head.sha }}" > api_diff.txt
echo "\`\`\`rust" >> api_diff.txt
cargo public-api diff >> api_diff.txt
echo "\`\`\`" >> api_diff.txt
cat api_diff.txt
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
- name: Create / update comment
if: ${{ github.event.pull_request }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: api_diff.txt
token: ${{ secrets.GITHUB_TOKEN }}
edit-mode: replace