diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a6ce9a2..a2870da7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,6 +73,7 @@ jobs: name: Building and releasing project runs-on: ubuntu-latest needs: [lint, build, test] + if: github.event_name == 'push' steps: - uses: actions/checkout@v3 with: @@ -112,4 +113,28 @@ jobs: - name: Clear SSH key run: | shred /tmp/id_ed25519 + + check-fast-forward: + name: Check if fast forwarding is possible + runs-on: ubuntu-latest + needs: [lint, build, test] + if: github.event_name == 'pull_request' + + permissions: + contents: read + # We appear to need write permission for both pull-requests and + # issues in order to post a comment to a pull request. + pull-requests: write + issues: write + + steps: + - name: Checking if fast forwarding is possible + uses: sequoia-pgp/fast-forward@v1 + with: + merge: false + # To reduce the workflow's verbosity, use 'on-error' + # to only post a comment when an error occurs, or 'never' to + # never post a comment. (In all cases the information is + # still available in the step's summary.) + comment: never # TODO @polymath-eric: add SonarCloud step when the account confusion is sorted