diff options
author | Silvan Mosberger <contact@infinisil.com> | 2023-08-19 01:24:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-19 01:24:00 +0200 |
commit | 850d2b1cb17564b5ea4e52c563d083d747aeb66e (patch) | |
tree | c3d5453243d9e956209b55887f281b02fb8e75f1 /.github | |
parent | 6d9caf9821e000de6fc846c90136705a7e966442 (diff) | |
parent | 5ab9271508e3b5c69f91bd0cdff48ce7534ae51b (diff) |
Merge pull request #249151 from tweag/direct-push-bot
Remove direct push detection GitHub action
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/direct-push.yml | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/.github/workflows/direct-push.yml b/.github/workflows/direct-push.yml deleted file mode 100644 index 9046022af662..000000000000 --- a/.github/workflows/direct-push.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Direct Push Warning" -on: - push: - branches: - - master - - release-** -permissions: - contents: read - -jobs: - build: - permissions: - contents: write # for peter-evans/commit-comment to comment on commit - runs-on: ubuntu-latest - if: github.repository_owner == 'NixOS' - env: - GITHUB_SHA: ${{ github.sha }} - GITHUB_REPOSITORY: ${{ github.repository }} - steps: - - name: Check if commit is a merge commit - id: ismerge - run: | - ISMERGE=$(curl -H 'Accept: application/vnd.github.groot-preview+json' -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ env.GITHUB_REPOSITORY }}/commits/${{ env.GITHUB_SHA }}/pulls | jq -r '.[] | select(.merge_commit_sha == "${{ env.GITHUB_SHA }}") | any') - echo "ismerge=$ISMERGE" >> $GITHUB_OUTPUT - # github events are eventually consistent, so wait until changes propagate to thier DB - - run: sleep 60 - if: steps.ismerge.outputs.ismerge != 'true' - - name: Warn if the commit was a direct push - if: steps.ismerge.outputs.ismerge != 'true' - uses: peter-evans/commit-comment@v2 - with: - body: | - @${{ github.actor }}, you pushed a commit directly to master/release branch - instead of going through a Pull Request. - - That's highly discouraged beyond the few exceptions listed - on https://github.com/NixOS/nixpkgs/issues/118661 |