diff --git a/README.md b/README.md index 7c7d9d6..00bc9c2 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} @@ -159,7 +158,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} @@ -169,25 +167,17 @@ jobs: ### Specify the input directory To run the action for parameters not declared at the root of the repository, -set the parameter `input` to the directory of your `buf.yaml` file. +set the parameter `input` and `breaking_against` to include a subdir to the path +of your `buf.yaml` file. These parameters are configured as a base input ref. ```yaml - uses: bufbuild/buf-action@v1 with: - input: -``` - -Breaking change detection by default will use the `input` value as a subdirectory for the breaking against value. -To customize this behavior, set the parameter `breaking_against` to the desired input. - -```yaml -- uses: bufbuild/buf-action@v1 - with: - input: + input: ${{ github.event.repository.clone_url }}#format=git,commit=${{ github.event.pull_request.head.sha }},subdir= breaking_against: ${{ github.event.repository.clone_url }}#format=git,commit=${{ github.event.pull_request.base.sha }},subdir= ``` -Alternatively, you can checkout the base for the breaking comparison to a local folder +Alternatively, you can checkout the head and base to a local folder and then set the value of `breaking_against` to the path of the base. ```yaml diff --git a/action.yml b/action.yml index 3566fad..940dc46 100644 --- a/action.yml +++ b/action.yml @@ -63,6 +63,7 @@ inputs: description: |- Input for the buf command. required: false + default: ${{ github.event.repository.clone_url }}#format=git,commit=${{ github.event.pull_request.head.sha || github.event.head }} paths: description: |- Limit to specific files or directories (separated by newlines). @@ -112,6 +113,7 @@ inputs: Input to compare against for breaking change detection. Defaults to the base branch of the pull request or the commit before the push. required: false + default: ${{ github.event.repository.clone_url }}#format=git,commit=${{ github.event.pull_request.base.sha || github.event.before }} push: description: |- diff --git a/examples/disable-skip/buf-ci.yaml b/examples/disable-skip/buf-ci.yaml index 65ea635..d041023 100644 --- a/examples/disable-skip/buf-ci.yaml +++ b/examples/disable-skip/buf-ci.yaml @@ -14,7 +14,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} diff --git a/examples/only-checks/buf-ci.yaml b/examples/only-checks/buf-ci.yaml index 58dea69..3157337 100644 --- a/examples/only-checks/buf-ci.yaml +++ b/examples/only-checks/buf-ci.yaml @@ -10,5 +10,4 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 diff --git a/examples/only-sync/buf-ci.yaml b/examples/only-sync/buf-ci.yaml index 3b6a9d4..99d5973 100644 --- a/examples/only-sync/buf-ci.yaml +++ b/examples/only-sync/buf-ci.yaml @@ -9,7 +9,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} diff --git a/examples/push-on-changes/buf-ci.yaml b/examples/push-on-changes/buf-ci.yaml index c4e48bc..f1febb9 100644 --- a/examples/push-on-changes/buf-ci.yaml +++ b/examples/push-on-changes/buf-ci.yaml @@ -18,7 +18,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} diff --git a/examples/skip-on-commits/buf-ci.yaml b/examples/skip-on-commits/buf-ci.yaml index b7582b7..b451672 100644 --- a/examples/skip-on-commits/buf-ci.yaml +++ b/examples/skip-on-commits/buf-ci.yaml @@ -9,7 +9,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} diff --git a/examples/skip-on-labels/buf-ci.yaml b/examples/skip-on-labels/buf-ci.yaml index 37637a8..4d86d8e 100644 --- a/examples/skip-on-labels/buf-ci.yaml +++ b/examples/skip-on-labels/buf-ci.yaml @@ -11,7 +11,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: token: ${{ secrets.BUF_TOKEN }} diff --git a/examples/validate-push/buf-ci.yaml b/examples/validate-push/buf-ci.yaml index 6f8dcff..ade310d 100644 --- a/examples/validate-push/buf-ci.yaml +++ b/examples/validate-push/buf-ci.yaml @@ -9,7 +9,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: # The token paramater is required to authenticate with the Buf Schema Registry. diff --git a/examples/version-env/buf-ci.yaml b/examples/version-env/buf-ci.yaml index 494d832..ef142ef 100644 --- a/examples/version-env/buf-ci.yaml +++ b/examples/version-env/buf-ci.yaml @@ -10,7 +10,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: setup_only: true diff --git a/examples/version-input/buf-ci.yaml b/examples/version-input/buf-ci.yaml index b856475..f821296 100644 --- a/examples/version-input/buf-ci.yaml +++ b/examples/version-input/buf-ci.yaml @@ -8,7 +8,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: setup_only: true diff --git a/examples/version-latest/buf-ci.yaml b/examples/version-latest/buf-ci.yaml index ce8b724..eb19830 100644 --- a/examples/version-latest/buf-ci.yaml +++ b/examples/version-latest/buf-ci.yaml @@ -8,7 +8,6 @@ jobs: buf: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: setup_only: true