cb34a0e75e
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 3 to 4. - [Release notes](https://github.com/peter-evans/create-or-update-comment/releases) - [Commits](https://github.com/peter-evans/create-or-update-comment/compare/v3...v4) --- updated-dependencies: - dependency-name: peter-evans/create-or-update-comment dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
44 lines
1.9 KiB
YAML
44 lines
1.9 KiB
YAML
name: Octocat commits check
|
|
on:
|
|
# ATTENTION: See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
|
# re security implications of using this trigger; in particular, no code from PR branches must
|
|
# be executed in any flows triggered by it
|
|
pull_request_target:
|
|
branches:
|
|
- main
|
|
- 1.*
|
|
- 2.*
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check if octocat commits are present?
|
|
id: octocat
|
|
env:
|
|
pull_request_number: ${{ github.event.pull_request.number }}
|
|
github_repository: ${{ github.repository }}
|
|
run: |
|
|
curl --silent -X "GET" https://api.github.com/repos/$github_repository/pulls/$pull_request_number/commits | jq '.[] | {author: .author.login}' | jq -r '.author' >> SORTED_AUTHORS.txt
|
|
|
|
while IFS=" " read -r AUTHOR;
|
|
do
|
|
if [[ $AUTHOR == *"null"* ]]; then
|
|
echo "OCTOCAT_COMMIT_FOUND=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
done < SORTED_AUTHORS.txt
|
|
- name: Create comment
|
|
if: ${{ steps.octocat.outputs.OCTOCAT_COMMIT_FOUND == 'true' }}
|
|
uses: peter-evans/create-or-update-comment@v4
|
|
with:
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
Hi @${{ github.event.pull_request.user.login }}. Thank you for your valuable contribution.
|
|
Please author your commit(s) using an email [linked to your GitHub account](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-graphs-on-your-profile/why-are-my-contributions-not-showing-up-on-my-profile).
|
|
- name: Check failure
|
|
if: ${{ steps.check.outputs.OCTOCAT_COMMIT_FOUND == 'true' }}
|
|
uses: actions/github-script@v7
|
|
continue-on-error: false
|
|
with:
|
|
script: |
|
|
throw new Error('Octocat commits found')
|